[][src]Struct abi_stable::type_layout::MonoTypeLayout

#[repr(C)]pub struct MonoTypeLayout { /* fields omitted */ }

The data in the type layout that does not depend on generic parameters.

Implementations

impl MonoTypeLayout[src]

pub fn name(&self) -> &'static str[src]

Gets the name of the type.

pub const fn repr_attr(&self) -> ReprAttr[src]

Gets the representation attribute of the type.

pub const fn mod_refl_mode(&self) -> ModReflMode[src]

Gets the ModReflMode for the type, whether this is a module whose definition can be reflected on at runtime.

pub const fn item_info(&self) -> &ItemInfo[src]

Gets information about where a type was declared.

pub const fn shared_vars(&self) -> &MonoSharedVars[src]

Gets the SharedVars of the type, containing the slices that many types inside TypeLayout contain ranges into.

pub const fn shared_vars_static(&'static self) -> &'static MonoSharedVars[src]

Gets the SharedVars of the type, containing the slices that many types inside TypeLayout contain ranges into.

This was defined as a workaround for an internal compiler error in nightly.

pub fn get_fields(&self) -> Option<CompTLFields>[src]

Gets the compressed versions of the fields of the type.

Return value

If this a:

  • primitive or opaque type: It returns None.

  • enum: It returns Some() with all the fields in the order that they were declared, ignoring variants.

  • structs/unions/prefix types: It returns Some() with all the fields in the order that they were declared.

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

Gets an iterator over all the names of the fields in the type.

pub fn get_field_name(&self, nth: usize) -> Option<&'static str>[src]

Gets the name of the nth field in the type. Returns None if there is no nth field.

Trait Implementations

impl Clone for MonoTypeLayout[src]

impl Copy for MonoTypeLayout[src]

impl Debug for MonoTypeLayout[src]

impl GetStaticEquivalent_ for MonoTypeLayout[src]

type StaticEquivalent = _static_MonoTypeLayout

impl Send for MonoTypeLayout[src]

impl StableAbi for MonoTypeLayout[src]

type IsNonZeroType = False

Whether this type has a single invalid bit-pattern. Read more

impl Sync for MonoTypeLayout[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<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