[][src]Trait abi_stable::nonexhaustive_enum::GetEnumInfo

pub unsafe trait GetEnumInfo: Sized {
    type Discriminant: ValidDiscriminant;
    type DefaultStorage;
    type DefaultInterface;

    pub const ENUM_INFO: &'static EnumInfo;

    pub fn discriminants() -> &'static [Self::Discriminant]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
;
pub fn is_valid_discriminant(discriminant: Self::Discriminant) -> bool; }

Describes the discriminant of an enum,and its valid values.

Safety

This must be an enum with a #[repr(C)] or #[repr(SomeInteFgerType)] attribute.

Associated Types

type Discriminant: ValidDiscriminant[src]

The type of the discriminant.

type DefaultStorage[src]

The default storage type, used to store this enum inside NonExhaustive<>, and allow the enum to grow in size in newer ABI compatible versions.

type DefaultInterface[src]

The default InterfaceType, used to determine the traits that are required when constructing a NonExhaustive<>, and are then usable afterwards.

Loading content...

Associated Constants

pub const ENUM_INFO: &'static EnumInfo[src]

Information about the enum.

Loading content...

Required methods

pub fn discriminants() -> &'static [Self::Discriminant]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

The values of the discriminants of each variant.

pub fn is_valid_discriminant(discriminant: Self::Discriminant) -> bool[src]

Whether discriminant is one of the valid discriminants for this enum in this context.

Loading content...

Implementors

impl GetEnumInfo for ValidTag[src]

type Discriminant = u8

type DefaultStorage = ValidTag_Storage

type DefaultInterface = ValidTag_Interface

Loading content...