Trait workflow_core::enums::EnumTrait
source · 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§
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<T>
fn from_str(str: &str) -> Option<T>
get enum value from the value string without namespace (i.e. Value
)
sourcefn from_str_ns(str: &str) -> Option<T>
fn from_str_ns(str: &str) -> Option<T>
get enum value from the value string with namespace (i.e. Enum::Value
)