pub trait EnumStr: Sized {
// Required methods
fn as_name(&self) -> &'static str;
fn as_aliases(&self) -> &'static [&'static str];
}Expand description
Convert between enum and string.
Derive this trait on unit enums via #[derive(EnumStr)].
Required Methods§
Sourcefn as_aliases(&self) -> &'static [&'static str]
fn as_aliases(&self) -> &'static [&'static str]
Returns all string names and aliases of this variant.
The first element is always the primary name (returned by as_name).
Subsequent elements are aliases added via alias_all and alias.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".