pub trait Describe: Sized + 'static {
// Required methods
fn caption() -> &'static str;
fn iter() -> impl Iterator<Item = &'static Self>;
fn into_iter() -> impl Iterator<Item = Self>;
fn rustdoc(&self) -> &'static str;
fn describe(&self) -> &'static str;
fn as_str(&self) -> &'static str;
fn as_str_ns(&self) -> &'static str;
fn from_str(str: &str) -> Option<Self>;
fn from_str_ns(str: &str) -> Option<Self>;
}
Expand description
Enum trait used by the Describe
derive macro
Required Methods§
Sourcefn caption() -> &'static str
fn caption() -> &'static str
return a caption for the enum declared by the #[caption=""]
attribute
Sourcefn iter() -> impl Iterator<Item = &'static Self>
fn iter() -> impl Iterator<Item = &'static Self>
return all permutations of the enum as an iterator
Sourcefn as_str_ns(&self) -> &'static str
fn as_str_ns(&self) -> &'static str
return enum value as a string with namespace (i.e. Enum::Value
)
Sourcefn from_str(str: &str) -> Option<Self>
fn from_str(str: &str) -> Option<Self>
get enum value from the value string without namespace (i.e. Value
)
Sourcefn from_str_ns(str: &str) -> Option<Self>
fn from_str_ns(str: &str) -> Option<Self>
get enum value from the value string with namespace (i.e. Enum::Value
)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.