fn gen_get_fn_direct_no_aggr(field: &Field, fn_name: Tstream) -> Tstream {
        // We have to borrow the field here since the quote! macro cannot parse self.*
        let field_name = &field.name;
        let field_type = &field.field_type;
        quote! {
            pub fn #fn_name(&self) -> #field_type {
                self.#field_name.clone()
            }
        }
    }
/// Generate "get" function for direct field.
/// Generated code for `cpu: Option<f64>`:
/// ```ignore
/// fn get_cpu_value(&self) -> Option<f64> {
///     self.cpu.clone()
/// }
/// ```
Generate "get" function for direct field.
Generate " get " function for direct field .
fn gen_get_fn_direct_no_aggr(field: &Field, fn_name: Tstream) -> Tstream {
        // We have to borrow the field here since the quote! macro cannot parse self.*
        let field_name = &field.name;
        let field_type = &field.field_type;
        quote! {
            pub fn #fn_name(&self) -> #field_type {
                self.#field_name.clone()
            }
        }
    }
fn gen_get_fn_direct_no_aggr ( field : & Field , fn_name : Tstream ) -> Tstream { // We have to borrow the field here since the quote! macro cannot parse self.* let field_name = & field . name ; let field_type = & field . field_type ; quote ! { pub fn fn_name ( self ) field_type { self field_name clone ( ) } } }
Generate "get" function for direct field.
Generate " get " function for direct field .
field
&Field
fn_name
Tstream
field
&Field
fn_name
Tstream