pub struct Generics {
    pub lt_token: Option<Lt>,
    pub params: Punctuated<GenericParam, Comma>,
    pub gt_token: Option<Gt>,
    pub where_clause: Option<WhereClause>,
}
Expand description

Lifetimes and type parameters attached an item

This is a custom variant of syn::Generics which supports trait as a parameter bound.

Fields§

§lt_token: Option<Lt>

<

§params: Punctuated<GenericParam, Comma>

Parameters

§gt_token: Option<Gt>

>

§where_clause: Option<WhereClause>

where bounds

Implementations§

Generate (impl_generics, where_clause) tokens

Combines generics from self and item_generics.

This is the equivalent of the first and third items output by syn::Generics::split_for_impl. Any instance of trait as a parameter bound is replaced by subst.

Note: use ty_generics from syn::Generics::split_for_impl or Self::ty_generics as appropriate.

Generate ty_generics tokens

Combines generics from self and item_generics.

This is the equivalent to the second item output by syn::Generics::split_for_impl.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Write self to the given TokenStream

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.