Trait StaticStrUnion

Source
pub trait StaticStrUnion: Union {
    // Required methods
    fn strs() -> Vec<&'static str>
       where Self: Sized;
    fn as_str(&self) -> &'static str;
    fn try_from_str(value: &str) -> Result<Self, Error>
       where Self: Sized;
}
Expand description

A trait for representing a &'static str union Don’t implement this trait manually, use the union macro instead

Required Methods§

Source

fn strs() -> Vec<&'static str>
where Self: Sized,

Return all variants as &'static str

Source

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

Returns the &'static str representation of the variant

Source

fn try_from_str(value: &str) -> Result<Self, Error>
where Self: Sized,

Tries to convert a &'static str to Self

Implementors§