Expand description
Traits and corresponding derive macros for enum-based encapsulation.
Traits§
- AsVariant
- Provides owned access to the current variant’s field.
- AsVariant
Mut - Provides mutable borrowed access to the current variant’s field.
- AsVariant
Ref - Provides borrowed access to the current variant’s field.
- From
Variant - Creates an instance of
Self
from the unambiguous field type of one of its variants. - Into
Variant - Returns the current variant’s field, consuming
self
. - Variant
Discriminant - Used to obtain an enum variant’s discriminant.
- Variant
Downcast - Convenience umbrella trait used to do a cheap
Derive Macros§
- AsVariant
- Derive macro generating an impl of the trait
FromVariant<T>
. - AsVariant
Mut - Derive macro generating an impl of the trait
From<T>
. - AsVariant
Ref - Derive macro generating an impl of the trait
FromVariant<T>
. - Encapsulate
- Umbrella derive macro.
- From
- Derive macro generating an impl of the trait
From<T>
. - From
Variant - Derive macro generating an impl of the trait
FromVariant<T>
. - Into
Variant - Derive macro generating an impl of the trait
IntoVariant<T>
. - TryInto
- Derive macro generating an impl of the trait
TryFrom<T>
. - Variant
Discriminant - Derive macro generating an impl of the trait
VariantDiscriminant
. - Variant
Downcast - Derive macro generating an impl of the trait
VariantDowncast
.