You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: utils.rs
    path of file: ./repos/telexide/telexide_proc_macros/src
    
    the code of the file until where you have to start completion: use proc_macro2::{Ident, Literal, Span, TokenStream};
use quote::{format_ident, quote, ToTokens};
use syn::{
    parenthesized,
    parse::{Parse, ParseStream, Result},
    punctuated::Punctuated,
    token::Comma,
    Field,
    GenericArgument,
    Path,
    PathArguments,
    PathSegment,
    Token,
    Type,
    TypePath,
};

pub struct ParenthesisedItems<T>(pub Punctuated<T, Comma>);

impl<T: Pa
    
    fn to_tokens(&self, stream: &mut proc_macro2::TokenStream) {
        let Self {
            mandatory_fields,
            settable_fields,
            struct_name,
        } = self;

        let new_fields = fields_to_tokenstreams(mandatory_fields, |(ident, ty)| {
            if ty.to_token_stream().to_string() == "String" {
                quote! {#ident:#ident.to_string()}
            } else {
                quote! {#ident:#ident}
            }
        });

        let mandatory_fields = fields_to_tokenstreams(mandatory_fields, |(ident, ty)| {
            if ty.to_token_stream().to_string() == "String" {
                quote! {#ident: impl ToString}
            } else {
                quote! {#ident:#ty}
            }
        });

        let set_function_names = fields_to_tokenstreams(settable_fields, |(ident, _)| {
            let ident = format_ident!("set_{}", ident);
            quote! {#ident}
        });

        let settable_names = fields_to_tokenstreams(settable_fields, |(ident, _)| quote! {#ident});

        let field_setting = fields_to_tokenstreams(settable_fields, |(ident, ty)| {
            if ty.to_token_stream().to_string() == "String" {
                quote! {#ident.to_string()}
            } else {
                quote! {#ident}
            }
        });

        let settable_fields = fields_to_tokenstreams(settable_fields, |(ident, ty)| {
            if ty.to_token_stream().to_string() == "String" {
                quote! {#ident: impl ToString}
            } else {
                quote! {#ident:#ty}
            }
        });

        stream.extend(quote! {
            impl #struct_name {
                pub fn new(#(#mandatory_fields),*) -> Self {
                    Self {
                        #(#new_fields,)*
                        #(#settable_names: std::default::Default::default()),*
                    }
                }

                #(pub fn #set_function_names(&mut self, #settable_fields) -> &mut Self {
                    self.#settable_names = Some(#field_setting);
                    self
                })*
            }
        })
    }