pub fn decode_derive(
    attr_name: &'static str,
    crate_name: Ident,
    trait_name: Ident,
    decode_name: Ident,
    deserialize_name: Ident,
    input: DeriveInput,
    tlv_encoding: TlvEncoding,
) -> Result<TokenStream2> {
    let (impl_generics, ty_generics, where_clause) =
        input.generics.split_for_impl();
    let ident_name = &input.ident;

    let global_param = ParametrizedAttr::with(attr_name, &input.attrs)?;

    match input.data {
        Data::Struct(data) => decode_struct_impl(
            attr_name,
            &crate_name,
            &trait_name,
            &decode_name,
            &deserialize_name,
            data,
            ident_name,
            global_param,
            impl_generics,
            ty_generics,
            where_clause,
            tlv_encoding,
        ),
        Data::Enum(data) => decode_enum_impl(
            attr_name,
            &crate_name,
            &trait_name,
            &decode_name,
            &deserialize_name,
            data,
            ident_name,
            global_param,
            impl_generics,
            ty_generics,
            where_clause,
        ),
        Data::Union(_) => Err(Error::new_spanned(
            &input,
            format!("Deriving `{}` is not supported in unions", trait_name),
        )),
    }
}
/// Performs actual derivation of the decode trait using the provided
/// information about trait parameters and requirements for TLV support (see
/// [`TlvEncoding`] description).
///
/// You will find example of the function use in the
/// [crate top-level documentation][crate].
Performs actual derivation of the decode trait using the provided
information about trait parameters and requirements for TLV support (see
[`TlvEncoding`] description).

You will find example of the function use in the
[crate top-level documentation][crate].
Performs actual derivation of the decode trait using the provided information about trait parameters and requirements for TLV support ( see [ ` TlvEncoding ` ] description ) . You will find example of the function use in the [ crate top - level documentation ] [ crate ] .
pub fn decode_derive(
    attr_name: &'static str,
    crate_name: Ident,
    trait_name: Ident,
    decode_name: Ident,
    deserialize_name: Ident,
    input: DeriveInput,
    tlv_encoding: TlvEncoding,
) -> Result<TokenStream2> {
    let (impl_generics, ty_generics, where_clause) =
        input.generics.split_for_impl();
    let ident_name = &input.ident;
    let global_param = ParametrizedAttr::with(attr_name, &input.attrs)?;
    match input.data {
        Data::Struct(data) => decode_struct_impl(
            attr_name,
            &crate_name,
            &trait_name,
            &decode_name,
            &deserialize_name,
            data,
            ident_name,
            global_param,
            impl_generics,
            ty_generics,
            where_clause,
            tlv_encoding,
        ),
        Data::Enum(data) => decode_enum_impl(
            attr_name,
            &crate_name,
            &trait_name,
            &decode_name,
            &deserialize_name,
            data,
            ident_name,
            global_param,
            impl_generics,
            ty_generics,
            where_clause,
        ),
        Data::Union(_) => Err(Error::new_spanned(
            &input,
            format!("Deriving `{}` is not supported in unions", trait_name),
        )),
    }
}
pub fn decode_derive ( attr_name : & ' static str , crate_name : Ident , trait_name : Ident , decode_name : Ident , deserialize_name : Ident , input : DeriveInput , tlv_encoding : TlvEncoding , ) -> Result < TokenStream2 > { let ( impl_generics , ty_generics , where_clause ) = input . generics . split_for_impl ( ) ; let ident_name = & input . ident ; let global_param = ParametrizedAttr :: with ( attr_name , & input . attrs ) ? ; match input . data { Data :: Struct ( data ) => decode_struct_impl ( attr_name , & crate_name , & trait_name , & decode_name , & deserialize_name , data , ident_name , global_param , impl_generics , ty_generics , where_clause , tlv_encoding , ) , Data :: Enum ( data ) => decode_enum_impl ( attr_name , & crate_name , & trait_name , & decode_name , & deserialize_name , data , ident_name , global_param , impl_generics , ty_generics , where_clause , ) , Data :: Union ( _ ) => Err ( Error :: new_spanned ( & input , format ! ( " " trait_name ) , ) ) , } }
Performs actual derivation of the decode trait using the provided
information about trait parameters and requirements for TLV support (see
[`TlvEncoding`] description).
Performs actual derivation of the decode trait using the provided information about trait parameters and requirements for TLV support ( see [ ` TlvEncoding ` ] description ) .
attr_name
&'static str
crate_name
Ident
trait_name
Ident
decode_name
Ident
deserialize_name
Ident
input
DeriveInput
tlv_encoding
TlvEncoding
attr_name
&'static str
crate_name
Ident
trait_name
Ident
decode_name
Ident
deserialize_name
Ident
input
DeriveInput
tlv_encoding
TlvEncoding