[][src]Struct abi_stable::type_layout::TLEnum

pub struct TLEnum {
    pub field_count: RSlice<'static, u8>,
    pub variant_names: RStr<'static>,
    pub fields: TLFields,
    pub exhaustiveness: IsExhaustive,
    pub discriminants: TLDiscriminants,
}

Every property about an enum specifically.

Fields

field_count: RSlice<'static, u8>

The amount of fields of each variant.

variant_names: RStr<'static>

A ';' separated list of all variant names

fields: TLFields

All the fields of the enums,not separated by variant.

exhaustiveness: IsExhaustive

The exhaustiveness of this enum.

discriminants: TLDiscriminants

The discriminants of the variants in the enum.

Implementations

impl TLEnum[src]

pub fn variant_count(&self) -> usize[src]

Returns the amount of variants in the enum.

pub fn variant_names_iter(
    &self
) -> impl ExactSizeIterator<Item = &'static str> + Clone + Debug + 'static
[src]

Returns an iterator over the names of the variants in this enum.

pub fn max_min<'a>(&'a self, other: &'a TLEnum) -> (&'a TLEnum, &'a TLEnum)[src]

Returns self and other sorted in a (maximum,minimum) pair, based on the amount of variants.

Trait Implementations

impl Clone for TLEnum[src]

impl Copy for TLEnum[src]

impl Debug for TLEnum[src]

impl Display for TLEnum[src]

impl Eq for TLEnum[src]

impl PartialEq<TLEnum> for TLEnum[src]

impl StructuralEq for TLEnum[src]

impl StructuralPartialEq for TLEnum[src]

Auto Trait Implementations

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<'a, T> BorrowOwned<'a> for T where
    T: 'a + Clone
[src]

type ROwned = T

The owned type, stored in RCow::Owned

type RBorrowed = &'a T

The borrowed type, stored in RCow::Borrowed

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

impl<T> GetWithMetadata for T[src]

type ForSelf = WithMetadata_<T, T>

This is always WithMetadata_<Self, Self>

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<This> TransmuteElement for This where
    This: ?Sized
[src]

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.

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

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

The error type returned when the conversion fails.

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

type Type = T

The same type as Self. Read more

impl<This> ValidTag_Bounds for This where
    This: Debug + Clone + PartialEq<This>, 
[src]