pub trait EnumTrait<T> {
    // Required methods
    fn list() -> Vec<T>;
    fn descr(&self) -> &'static str;
    fn as_str(&self) -> &'static str;
    fn as_str_ns(&self) -> &'static str;
    fn from_str(str: &str) -> Option<T>;
    fn from_str_ns(str: &str) -> Option<T>;
}
Expand description

Enum trait used by the Describe derive macro

Required Methods§

source

fn list() -> Vec<T>

return all permutations of the enum

source

fn descr(&self) -> &'static str

return rustdoc text describing the enum value

source

fn as_str(&self) -> &'static str

return enum value as a string without namespace (i.e. Value)

source

fn as_str_ns(&self) -> &'static str

return enum value as a string with namespace (i.e. Enum::Value)

source

fn from_str(str: &str) -> Option<T>

get enum value from the value string without namespace (i.e. Value)

source

fn from_str_ns(str: &str) -> Option<T>

get enum value from the value string with namespace (i.e. Enum::Value)

Implementors§