Struct impl_tools_lib::Singleton
source · pub struct Singleton {
pub attrs: Vec<Attribute>,
pub token: Struct,
pub generics: Generics,
pub style: StructStyle,
pub fields: Punctuated<SingletonField, Comma>,
pub impls: Vec<ItemImpl>,
}
Expand description
A struct with a single instantiation
The singleton macro may be used to conveniently declare a struct’s type, implementations and construct an instance. This struct represents the macro’s input.
Fields§
§attrs: Vec<Attribute>
Struct attributes
token: Struct
struct
token
generics: Generics
(Explicit) struct generics
Note: the macro instantiated type may have extra generics.
style: StructStyle
Struct style: unit/tuple/regular
fields: Punctuated<SingletonField, Comma>
Struct fields
impls: Vec<ItemImpl>
(Explicit) struct implementations
Implementations§
source§impl Singleton
impl Singleton
sourcepub fn into_scope(self) -> SingletonScope
pub fn into_scope(self) -> SingletonScope
Convert to a SingletonScope