Crate delve

Source
Expand description

§delve

A bunch of macros to improve working with enums and strings.

githubcrates-iodocs-rs

Modules§

ContainerAttributes
Container Attributes
FieldAttributes
Field Attributes
TupleAttributes
Tuple Attributes
VariantAttributes
Variant Attributes

Enums§

ParseError
The error returned in FromStr if it failed to parse the string into a variant.

Traits§

FieldNames
A trait that returns the field names from within a struct variant. Use delve_derive::EnumFields to automatically derive this trait.
HasVariant
A trait that returns whether a given variant name exists in the enum. Unlike checking if the variant name exists using the VariantNames trait, this is not affected by inflections. Use delve_derive::EnumHasVariant to automatically derive this trait.
ModifyField
A trait that allows the modification of arguments within a tuple or struct variant. Use delve_derive::EnumModify to automatically derive this trait.
TupleCount
A trait that returns the number of types within a tuple variant. Use delve_derive::EnumTuples to automatically derive this trait.
VariantCount
A trait for getting the number of variants in an enum. Use delve_derive::EnumVariantCount to automatically derive this trait.
VariantNames
A trait for getting the names of the variants in an enum. Use delve_derive::EnumVariantNames to automatically derive this trait.

Derive Macros§

EnumDisplayderive
Implements core::fmt::Display on an enum.
EnumFieldsderive
Implements delve::FieldNames which provides the names of the fields within a struct variant. See FieldNames for an example implementation.
EnumFromStrderive
Implements core::str::FromStr on an enum.
EnumHasVariantderive
Implements delve::HasVariant which returns whether a given variant name exists in the enum. See HasVariant for an example implementation.
EnumModifyderive
Implements delve::ModifyField which allows the modification of arguments within a tuple or struct variant. See ModifyField for an example implementation.
EnumToStrderive
Implements From<TheEnum> for &'static str and From<&TheEnum> for &'static str on an enum. The Rust std provides a blanket implementation for the reverse so Into<&'static str> for (&)TheEnum is also implemented.
EnumTuplesderive
Implements delve::TupleCount which provides the number of type arguments in a tuple variant. See TupleCount for an example implementation.
EnumVariantCountderive
Implements delve::VariantCount which provides the number of variants within an enum. See VariantCount for an example implementation.
EnumVariantNamesderive
Implements delve::VariantNames which provides the names of all the variants within an enum. See VariantNames for an example implementation.