Crate enumcapsulate

Source
Expand description

Traits and corresponding derive macros for enum-based encapsulation.

Traits§

AsVariant
Provides owned access to the current variant’s field.
AsVariantMut
Provides mutable borrowed access to the current variant’s field.
AsVariantRef
Provides borrowed access to the current variant’s field.
FromVariant
Creates an instance of Self from the unambiguous field type of one of its variants.
IntoVariant
Returns the current variant’s field, consuming self.
VariantDiscriminant
Used to obtain an enum variant’s discriminant.
VariantDowncast
Convenience umbrella trait used to do a cheap

Derive Macros§

AsVariant
Derive macro generating an impl of the trait FromVariant<T>.
AsVariantMut
Derive macro generating an impl of the trait From<T>.
AsVariantRef
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>.
FromVariant
Derive macro generating an impl of the trait FromVariant<T>.
IntoVariant
Derive macro generating an impl of the trait IntoVariant<T>.
TryInto
Derive macro generating an impl of the trait TryFrom<T>.
VariantDiscriminant
Derive macro generating an impl of the trait VariantDiscriminant.
VariantDowncast
Derive macro generating an impl of the trait VariantDowncast.