[][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.

This is stored in a static for every type that derives StableAbi.

Methods

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 this type, containing the slices that many types inside TypeLayout contain ranges into.

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

Gets the compressed versions of the fields of this 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 the were declared.

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

Gets an iterator over all the named 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 GetStaticEquivalent_ for MonoTypeLayout[src]

type StaticEquivalent = _static_MonoTypeLayout

impl SharedStableAbi for MonoTypeLayout[src]

type IsNonZeroType = False

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

type Kind = __ValueKind

The kind of abi stability of this type,there are 2: Read more

impl Send for MonoTypeLayout[src]

impl Sync for MonoTypeLayout[src]

impl Clone for MonoTypeLayout[src]

impl Copy for MonoTypeLayout[src]

impl Debug for MonoTypeLayout[src]

Auto Trait Implementations

Blanket Implementations

impl<This> StableAbi for This where
    This: SharedStableAbi<Kind = ValueKind>, 
[src]

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

impl<'a, T> BorrowOwned<'a> for T where
    T: 'a + Clone
[src]

type ROwned = T

type RBorrowed = &'a T

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

type Type = T

The same type as Self. Read more

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

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.