pub struct SingletonField {
    pub attrs: Vec<Attribute>,
    pub vis: Visibility,
    pub ident: Option<Ident>,
    pub colon_token: Option<Colon>,
    pub ty: Type,
    pub assignment: Option<(Eq, Expr)>,
}
Expand description

A field of a Singleton

Fields§

§attrs: Vec<Attribute>

Field attributes

§vis: Visibility

Field visibility

§ident: Option<Ident>

Field identifier (regular structs only, and optional even there)

§colon_token: Option<Colon>

Separator between identifier and type

This is present only given an explicit identifier and an explicit type.

§ty: Type

Field type

In case the type is omitted, this has value Type::Infer.

§assignment: Option<(Eq, Expr)>

Optional non-default value assignment

Trait Implementations§

Formats the value using the given formatter. Read more

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.