Module derive_tools::orphan

source ·
Expand description

Orphan namespace of the module.

Modules

Enums

  • The ParseError enum is a collection of all the possible reasons an enum can fail to parse from a string.

Traits

  • AsStaticRefDeprecated
    A cheap reference-to-reference conversion. Used to convert a value to a reference value with 'static lifetime within generic code.
  • A trait for capturing the number of variants in Enum. This trait can be autoderived by strum_macros.
  • Associates additional pieces of information with an Enum. This can be autoimplemented by deriving EnumMessage and annotating your variants with #[strum(message="...")].
  • EnumProperty is a trait that makes it possible to store additional information with enum variants. This trait is designed to be used with the macro of the same name in the strum_macros crate. Currently, the only string literals are supported in attributes, the other methods will be implemented as additional attribute types become stabilized.
  • This trait designates that an Enum can be iterated over. It can be auto generated using strum_macros on your behalf.
  • A trait for retrieving the names of each variant in Enum. This trait can be autoderived by strum_macros.

Functions

Attribute Macros

  • Derive macro to generate former for a structure. Former is variation of Builder Pattern.

Derive Macros

  • Derive macro to implement AsMut when-ever it’s possible to do automatically.
  • Derive macro to implement AsRef when-ever it’s possible to do automatically.
  • Converts enum variants to &'static str.
  • Derive macro to implement Deref when-ever it’s possible to do automatically.
  • Derive macro to implement Deref when-ever it’s possible to do automatically.
  • Add a constant usize equal to the number of variants.
  • Generate a new type with only the discriminant names.
  • Creates a new type that iterates of the variants of an enum.
  • Add a verbose message to an enum variant.
  • Add custom properties to enum variants.
  • Converts strings to enum variants based on their name.
  • Implements Strum::VariantNames which adds an associated constant VARIANTS which is an array of discriminant names.
  • Derive macro to implement From converting inner type into outer when-ever it’s possible to do automatically.
  • Derive macro to implement From converting inner type into outer when-ever it’s possible to do automatically.
  • Add a function to enum that allows accessing variants by its discriminant
  • Derive macro to implement From converting outer type into inner when-ever it’s possible to do automatically.
  • Implements From<MyEnum> for &'static str on an enum.
  • implements std::string::ToString on en enum