num_enum

Trait TryFromPrimitive

source
pub trait TryFromPrimitive: Sized {
    type Primitive: Copy + Eq + Debug;
    type Error;

    const NAME: &'static str;

    // Required method
    fn try_from_primitive(number: Self::Primitive) -> Result<Self, Self::Error>;
}

Required Associated Constants§

source

const NAME: &'static str

Required Associated Types§

Required Methods§

source

fn try_from_primitive(number: Self::Primitive) -> Result<Self, Self::Error>

Object Safety§

This trait is not object safe.

Implementors§