pub struct Enum {
    pub meta: Option<Meta>,
    pub name: String,
    pub module_name: Option<String>,
    pub visibility: Visibility,
    /* private fields */
}

Fields§

§meta: Option<Meta>§name: String§module_name: Option<String>§visibility: Visibility

Implementations§

source§

impl Enum

source

pub fn is_runtime(&self) -> bool

source

pub fn is_native(&self) -> bool

source

pub fn is_send(&self) -> bool

source

pub fn is_sync(&self) -> bool

source

pub fn is_copy(&self) -> bool

source

pub fn can_initialize(&self) -> bool

source

pub fn type_hash(&self) -> TypeHash

source

pub fn type_name(&self) -> &str

source

pub fn layout(&self) -> &Layout

source

pub fn variants(&self) -> &[EnumVariant]

source

pub fn default_variant_discriminant(&self) -> Option<u8>

source

pub fn default_variant(&self) -> Option<&EnumVariant>

source

pub fn is_compatible(&self, other: &Enum) -> bool

source

pub fn find_variants<'a>( &'a self, query: EnumVariantQuery<'a> ) -> impl Iterator<Item = &'a EnumVariant> + 'a

source

pub fn find_variant<'a>( &'a self, query: EnumVariantQuery<'a> ) -> Option<&'a EnumVariant>

source

pub unsafe fn find_variant_by_value<T>(&self, value: &T) -> Option<&EnumVariant>
where T: 'static,

§Safety
source

pub fn find_variant_by_discriminant( &self, discriminant: u8 ) -> Option<&EnumVariant>

source

pub unsafe fn try_copy(&self, from: *const u8, to: *mut u8) -> bool

§Safety
source

pub unsafe fn initialize(&self, pointer: *mut ()) -> bool

§Safety
source

pub unsafe fn finalize(&self, pointer: *mut ())

§Safety
source

pub unsafe fn initializer(&self) -> Option<unsafe fn(_: *mut ())>

§Safety
source

pub unsafe fn finalizer(&self) -> unsafe fn(_: *mut ())

§Safety
source

pub fn into_type(self) -> Type

Trait Implementations§

source§

impl Debug for Enum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<Enum> for NativeEnumBuilder

source§

fn from(value: Enum) -> NativeEnumBuilder

Converts to this type from the input type.
source§

impl From<Enum> for RuntimeEnumBuilder

source§

fn from(value: Enum) -> RuntimeEnumBuilder

Converts to this type from the input type.
source§

impl From<Enum> for Type

source§

fn from(value: Enum) -> Type

Converts to this type from the input type.
source§

impl PartialEq for Enum

source§

fn eq(&self, other: &Enum) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl Freeze for Enum

§

impl RefUnwindSafe for Enum

§

impl Send for Enum

§

impl Sync for Enum

§

impl Unpin for Enum

§

impl UnwindSafe for Enum

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Finalize for T

source§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.