Trait bilrost::Enumeration
source · pub trait Enumeration: Eq + Sized {
// Required methods
fn to_number(&self) -> u32;
fn try_from_number(n: u32) -> Result<Self, u32>;
fn is_valid(n: u32) -> bool;
}
Expand description
Proxy trait for enumeration types conversions to and from u32
Required Methods§
sourcefn try_from_number(n: u32) -> Result<Self, u32>
fn try_from_number(n: u32) -> Result<Self, u32>
Tries to convert from the given number to the enumeration type.
Object Safety§
This trait is not object safe.