Skip to main content

Crate enum_traits_macros

Crate enum_traits_macros 

Source
Expand description

Derives additional functionalities for enum items using procedural macros.

Also see [enum_traits] for some of the traits that this library derives.

Modulesยง

enum_ends ๐Ÿ”’
enum_from_discriminant ๐Ÿ”’
enum_from_index ๐Ÿ”’
enum_from_variant_fields ๐Ÿ”’
enum_from_variant_name ๐Ÿ”’
enum_index ๐Ÿ”’
enum_is_variant_fns ๐Ÿ”’
enum_iter ๐Ÿ”’
enum_iterator ๐Ÿ”’
enum_len ๐Ÿ”’
enum_step ๐Ÿ”’
enum_tag ๐Ÿ”’
enum_to_index ๐Ÿ”’
enum_variant_name ๐Ÿ”’
util ๐Ÿ”’

Functionsยง

attr_enum ๐Ÿ”’
derive_enum ๐Ÿ”’

Attribute Macrosยง

impl_enum_first
Implements a constant to the first variant in the enum.
impl_enum_last
Implements a constant to the last variant in the enum.
impl_enum_len
Implements a length constant to the enum.

Derive Macrosยง

EnumEnds
Implements [enum_traits::Ends].
EnumFromDiscriminant
Implements [enum_traits::FromDiscriminant] for any discriminant type.
EnumFromIndex
Implements [enum_traits::FromIndex].
EnumFromVariantFields
Implements From for all variants in the enum by using the type of the fields.
EnumFromVariantName
Implements core::str::FromStr.
EnumIndex
Implements [enum_traits::Index].
EnumIsVariantFns
Implements functions that checks if an value of the enum matches a certain variant.
EnumIter
Creates a struct representing the iterator state and implements [enum_traits::Iterable].
EnumIterator
Implements Iterator.
EnumLen
Implements [enum_traits::Len].
EnumStep
Implements [enum_traits::Step].
EnumTag
Creates an enum with unit variants from the derived enum, and implements [enum_traits::Tag].
EnumToIndex
Implements [enum_traits::ToIndex].
EnumVariantName
Implements [enum_traits::EnumVariantName].