TryFromPrimitive

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>

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§

Source§

impl TryFromPrimitive for Class

Source§

impl TryFromPrimitive for FootprintsSpell

Source§

impl TryFromPrimitive for Grade

Source§

impl TryFromPrimitive for KillEaterScoreType

Source§

const NAME: &'static str = "KillEaterScoreType"

Source§

type Primitive = u32

Source§

type Error = TryFromPrimitiveError<KillEaterScoreType>

Source§

impl TryFromPrimitive for KillstreakTier

Source§

impl TryFromPrimitive for Killstreaker

Source§

impl TryFromPrimitive for Origin

Source§

impl TryFromPrimitive for Paint

Source§

impl TryFromPrimitive for PaintSpell

Source§

impl TryFromPrimitive for Quality

Source§

impl TryFromPrimitive for Sheen

Source§

impl TryFromPrimitive for StockWeapon

Source§

impl TryFromPrimitive for StrangePart

Source§

impl TryFromPrimitive for Wear