Enum packed_struct::EnumCatchAll [−][src]
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
Methods
impl<E> EnumCatchAll<E> where
E: PrimitiveEnum,
[src]
impl<E> EnumCatchAll<E> where
E: PrimitiveEnum,
Trait Implementations
impl<E: Copy> Copy for EnumCatchAll<E> where
E: PrimitiveEnum,
E::Primitive: Copy,
[src]
impl<E: Copy> Copy for EnumCatchAll<E> where
E: PrimitiveEnum,
E::Primitive: Copy,
impl<E: Clone> Clone for EnumCatchAll<E> where
E: PrimitiveEnum,
E::Primitive: Clone,
[src]
impl<E: Clone> Clone for EnumCatchAll<E> where
E: PrimitiveEnum,
E::Primitive: Clone,
fn clone(&self) -> EnumCatchAll<E>
[src]
fn clone(&self) -> EnumCatchAll<E>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<E: Debug> Debug for EnumCatchAll<E> where
E: PrimitiveEnum,
E::Primitive: Debug,
[src]
impl<E: Debug> Debug for EnumCatchAll<E> where
E: PrimitiveEnum,
E::Primitive: Debug,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<E> From<E> for EnumCatchAll<E> where
E: PrimitiveEnum,
[src]
impl<E> From<E> for EnumCatchAll<E> where
E: PrimitiveEnum,
impl<E> PartialEq<Self> for EnumCatchAll<E> where
E: PrimitiveEnum,
[src]
impl<E> PartialEq<Self> for EnumCatchAll<E> where
E: PrimitiveEnum,
fn eq(&self, other: &Self) -> bool
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<E> PrimitiveEnum for EnumCatchAll<E> where
E: PrimitiveEnum,
[src]
impl<E> PrimitiveEnum for EnumCatchAll<E> where
E: PrimitiveEnum,
type Primitive = E::Primitive
The primitve type into which we serialize and deserialize ourselves.
fn from_primitive(val: E::Primitive) -> Option<Self>
[src]
fn from_primitive(val: E::Primitive) -> Option<Self>
Convert from a primitive, might fail.
fn to_primitive(&self) -> E::Primitive
[src]
fn to_primitive(&self) -> E::Primitive
Convert to a primitive value.
fn from_str(s: &str) -> Option<Self>
[src]
fn from_str(s: &str) -> Option<Self>
Convert from a string value representing the variant. Case sensitive.
fn from_str_lower(s: &str) -> Option<Self>
[src]
fn from_str_lower(s: &str) -> Option<Self>
Convert from a string value representing the variant. Lowercase.
impl<E> PrimitiveEnumDynamicStr for EnumCatchAll<E> where
E: PrimitiveEnum + PrimitiveEnumDynamicStr,
[src]
impl<E> PrimitiveEnumDynamicStr for EnumCatchAll<E> where
E: PrimitiveEnum + PrimitiveEnumDynamicStr,
fn to_display_str(&self) -> Cow<'static, str>
[src]
fn to_display_str(&self) -> Cow<'static, str>
Display value, same as the name of a particular variant.
fn all_variants() -> Cow<'static, [Self]>
[src]
fn all_variants() -> Cow<'static, [Self]>
A list all possible string variants.
Auto Trait Implementations
impl<E> Send for EnumCatchAll<E> where
E: Send,
<E as PrimitiveEnum>::Primitive: Send,
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> Sync for EnumCatchAll<E> where
E: Sync,
<E as PrimitiveEnum>::Primitive: Sync,