pub enum SubstructureFields<'a> {
    Struct(&'a VariantDataVec<FieldInfo>),
    EnumMatching(usizeusize, &'a VariantVec<FieldInfo>),
    EnumTag(FieldInfoOption<P<Expr>>),
    StaticStruct(&'a VariantDataStaticFields),
    StaticEnum(&'a EnumDefVec<(Ident, Span, StaticFields)>),
}
Expand description

A summary of the possible sets of fields.

Variants§

§

Struct(&'a VariantDataVec<FieldInfo>)

A non-static method with Self is a struct.

§

EnumMatching(usizeusize, &'a VariantVec<FieldInfo>)

Matching variants of the enum: variant index, variant count, ast::Variant, fields: the field name is only non-None in the case of a struct variant.

§

EnumTag(FieldInfoOption<P<Expr>>)

The tag of an enum. The first field is a FieldInfo for the tags, as if they were fields. The second field is the expression to combine the tag expression with; it will be None if no match is necessary.

§

StaticStruct(&'a VariantDataStaticFields)

A static method where Self is a struct.

§

StaticEnum(&'a EnumDefVec<(Ident, Span, StaticFields)>)

A static method where Self is an enum.

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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 64 bytes

Size for each variant:

  • Struct: 32 bytes
  • EnumMatching: 48 bytes
  • EnumTag: 64 bytes
  • StaticStruct: 40 bytes
  • StaticEnum: 32 bytes