EnumFromStr

Trait EnumFromStr 

Source
pub trait EnumFromStr
where Self: Sized,
{ // Required methods fn create( variant: &str, argument: &str, prefix: Option<u32>, ) -> Result<Self, String>; fn has_argument(variant: &str) -> Result<bool, String>; }
Expand description

The EnumFromStr trait is used to specify how to construct an enum value from a string.

Required Methods§

Source

fn create( variant: &str, argument: &str, prefix: Option<u32>, ) -> Result<Self, String>

Create the enum value from the variant string and an argument string.

Source

fn has_argument(variant: &str) -> Result<bool, String>

Check wether the enum variant has an argument.

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.

Implementors§