Crate enumcapsulate

Source
Expand description

Traits and corresponding derive macros for enum-based encapsulation.

Traits§

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

Derive Macros§

  • Derive macro generating an impl of the trait FromVariant<T>.
  • Derive macro generating an impl of the trait From<T>.
  • Derive macro generating an impl of the trait FromVariant<T>.
  • Umbrella derive macro.
  • Derive macro generating an impl of the trait From<T>.
  • Derive macro generating an impl of the trait FromVariant<T>.
  • Derive macro generating an impl of the trait IntoVariant<T>.
  • Derive macro generating an impl of the trait TryFrom<T>.
  • Derive macro generating an impl of the trait VariantDiscriminant.
  • Derive macro generating an impl of the trait VariantDowncast.