Crate variant_access_traits
Source - VariantAccessError
- Custom errors for this crate. Keeps a record of
the enum and requested type that produced the error
- ContainsVariant
- This trait is for querying an enum.
- CreateVariantFrom
- This trait allows one to create a new instance of an enum
from a value whose type matches one of the types of the
field of the enum.
- GetVariant
- This trait is for extracting a reference to the raw
values in an enum
- SetVariant
- This trait is for setting an inner value with the correct
associated type to the given value
- create_variant_from
- This function allows the user to call a type’s
create_variant_from
trait method without explicitly naming the type: