Skip to main content

EnumVariantsStrings

Trait EnumVariantsStrings 

Source
pub trait EnumVariantsStrings: Sized {
    // Required methods
    fn from_str(input: &str) -> Result<Self, &[&str]>;
    fn to_str(&self) -> &'static str;
}

Required Methods§

Source

fn from_str(input: &str) -> Result<Self, &[&str]>

Returns a instance of variant of Self which matches input if exists, else returns possible matches

Source

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

Returns the string representation of selfs variant

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§