[][src]Enum packed_struct::EnumCatchAll

pub enum EnumCatchAll<E> where
    E: PrimitiveEnum
{ Enum(E), CatchAll(E::Primitive), }

A wrapper for primitive enums that supports catching and retaining any values that don't have defined discriminants.

Variants

Enum(E)

A matched discriminant

CatchAll(E::Primitive)

Some other value, stored as the primitive type

Implementations

impl<E> EnumCatchAll<E> where
    E: PrimitiveEnum
[src]

pub fn from_enum(v: E) -> Self[src]

Trait Implementations

impl<E: Clone> Clone for EnumCatchAll<E> where
    E: PrimitiveEnum,
    E::Primitive: Clone
[src]

impl<E: Copy> Copy for EnumCatchAll<E> where
    E: PrimitiveEnum,
    E::Primitive: Copy
[src]

impl<E: Debug> Debug for EnumCatchAll<E> where
    E: PrimitiveEnum,
    E::Primitive: Debug
[src]

impl<E> From<E> for EnumCatchAll<E> where
    E: PrimitiveEnum
[src]

impl<E> PartialEq<EnumCatchAll<E>> for EnumCatchAll<E> where
    E: PrimitiveEnum
[src]

impl<E> PrimitiveEnum for EnumCatchAll<E> where
    E: PrimitiveEnum
[src]

type Primitive = E::Primitive

The primitve type into which we serialize and deserialize ourselves.

impl<E> PrimitiveEnumDynamicStr for EnumCatchAll<E> where
    E: PrimitiveEnum + PrimitiveEnumDynamicStr
[src]

fn to_display_str(&self) -> Cow<'static, str>[src]

Display value, same as the name of a particular variant.

Auto Trait Implementations

impl<E> RefUnwindSafe for EnumCatchAll<E> where
    E: RefUnwindSafe,
    <E as PrimitiveEnum>::Primitive: RefUnwindSafe

impl<E> Send for EnumCatchAll<E> where
    E: Send,
    <E as PrimitiveEnum>::Primitive: Send

impl<E> Sync for EnumCatchAll<E> where
    E: Sync,
    <E as PrimitiveEnum>::Primitive: Sync

impl<E> Unpin for EnumCatchAll<E> where
    E: Unpin,
    <E as PrimitiveEnum>::Primitive: Unpin

impl<E> UnwindSafe for EnumCatchAll<E> where
    E: UnwindSafe,
    <E as PrimitiveEnum>::Primitive: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.