[][src]Struct abi_stable::type_layout::TypeLayout

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

The layout of a type, also includes metadata about where the type was defined.

Implementations

impl TypeLayout[src]

pub const fn shared_vars(&self) -> &'static SharedVars[src]

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

pub fn package_and_version(&self) -> (RStr<'static>, VersionStrings)[src]

Gets the package and package version where the type was declared.

pub fn package(&self) -> RStr<'static>[src]

Gets the package where the type was declared.

pub fn package_version(&self) -> VersionStrings[src]

Gets the package version for the package where the type was declared.

pub fn line(&self) -> u32[src]

Gets which line the type was defined in.

pub fn mod_path(&self) -> ModPath[src]

Gets the full path to the module where the type was defined.

pub fn extra_checks(&self) -> Option<ExtraChecksStaticRef>[src]

Gets a trait object used to check extra properties about the type.

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

Gets 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 is_prefix_kind(&self) -> bool[src]

Whether this is a prefix-type(module or vtable).

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

Gets the name of the type.

pub fn is_nonzero(&self) -> bool[src]

Gets whether the type is a NonZero type, which can be put in an Option while being ffi-safe.

pub fn get_utypeid(&self) -> UTypeId[src]

Gets the UTypeId for the type, which is an ffi safe equivalent of TypeId.

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

Gets information about where a type was declared.

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

Gets the alignment of the type.

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

Gets the size of the type.

pub fn tag(&self) -> &'static Tag[src]

Gets the Tag associated with a type, a JSON-like datastructure which is another way to check extra properties about a type.

pub 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 fn data(&self) -> TLData[src]

The interior of the type definition, describing whether the type is a primitive/enum/struct/union and its contents.

pub fn data_discriminant(&self) -> TLDataDiscriminant[src]

Describes whether the type is a primitive/enum/struct/union, every variant corresponds to a TLData variant of the same name.

pub fn phantom_fields(&self) -> TLFields[src]

Gets the virtual fields that aren't part of th type definition, but are checked as part of the type

pub fn generics(&self) -> GenericParams[src]

Gets the generic parameters of the type.

pub fn mono_type_layout(&self) -> &MonoTypeLayout[src]

Gets the parts of the type layout that don't change with generic parameters.

Trait Implementations

impl Clone for TypeLayout[src]

impl Copy for TypeLayout[src]

impl Debug for TypeLayout[src]

impl Display for TypeLayout[src]

impl Eq for TypeLayout[src]

impl GetStaticEquivalent_ for TypeLayout[src]

type StaticEquivalent = _static_TypeLayout

impl PartialEq<TypeLayout> for TypeLayout[src]

impl Send for TypeLayout[src]

impl StableAbi for TypeLayout[src]

type IsNonZeroType = False

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

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