fn struct_fields(input: &DeriveInput) -> Result<Vec<Field>, TokenStream> {
    match &input.data {
        Data::Struct(x) => {
            let fields = x.fields
                .iter()
                .cloned()
                .collect::<Vec<_>>();
            Ok(fields)
        },
        _ => Err(crate::utils::error(
                    input.ident.span(),
                    "The given type is not supported".into()
                )
            )
    }
}
/// Extracts all fields from the struct.
///
/// # Params
///
/// * `input` - Information about the struct the fields should be extract from
///
/// # Error
///
/// Returns an error of the struct type is not supported
///
/// # Returns
///
/// Vec of [syn::Field]
///
Extracts all fields from the struct.
Extracts all fields from the struct .
fn struct_fields(input: &DeriveInput) -> Result<Vec<Field>, TokenStream> {
    match &input.data {
        Data::Struct(x) => {
            let fields = x.fields
                .iter()
                .cloned()
                .collect::<Vec<_>>();
            Ok(fields)
        },
        _ => Err(crate::utils::error(
                    input.ident.span(),
                    "The given type is not supported".into()
                )
            )
    }
}
fn struct_fields ( input : & DeriveInput ) -> Result < Vec < Field > , TokenStream > { match & input . data { Data :: Struct ( x ) => { let fields = x . fields . iter ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ; Ok ( fields ) } , _ => Err ( crate :: utils :: error ( input . ident . span ( ) , " " . into ( ) ) ) } }
Extracts all fields from the struct.
Extracts all fields from the struct .
input
&DeriveInput
Vec of [syn::Field]
Vec of [ syn :: Field ]
input
&DeriveInput
params
`input` - Information about the struct the fields should be extract from
` input ` - Information about the struct the fields should be extract from
error
Returns an error of the struct type is not supported
Returns an error of the struct type is not supported