pub trait ValuedEnum<T>where
Self: Sized,{
// Required methods
fn equal(&self, other: &T) -> bool;
fn key(&self) -> &str;
fn value(self) -> T;
fn ref_value(&self) -> &T;
fn keys() -> Vec<&'static str>;
fn values() -> Vec<T>;
fn variants() -> Vec<Self>;
fn from_key(key: &str) -> Option<Self>;
fn from_value(value: &T) -> Option<Self>;
}
Required Methods§
fn equal(&self, other: &T) -> bool
fn key(&self) -> &str
fn value(self) -> T
fn ref_value(&self) -> &T
fn keys() -> Vec<&'static str>
fn values() -> Vec<T>
fn variants() -> Vec<Self>
fn from_key(key: &str) -> Option<Self>
fn from_value(value: &T) -> Option<Self>
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.