Struct abi_stable::type_layout::TypeLayout
source · #[repr(C)]pub struct TypeLayout { /* private fields */ }
Expand description
The layout of a type, also includes metadata about where the type was defined.
Implementations
sourceimpl TypeLayout
impl TypeLayout
Gets the SharedVars of the type, containing the slices that many types inside TypeLayout contain ranges into.
sourcepub fn package_and_version(&self) -> (RStr<'static>, VersionStrings)
pub fn package_and_version(&self) -> (RStr<'static>, VersionStrings)
Gets the package and package version where the type was declared.
sourcepub fn package_version(&self) -> VersionStrings
pub fn package_version(&self) -> VersionStrings
Gets the package version for the package where the type was declared.
sourcepub fn extra_checks(&self) -> Option<ExtraChecksStaticRef>
pub fn extra_checks(&self) -> Option<ExtraChecksStaticRef>
Gets a trait object used to check extra properties about the type.
sourcepub fn get_fields(&self) -> Option<TLFields>
pub fn get_fields(&self) -> Option<TLFields>
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.
sourcepub fn is_prefix_kind(&self) -> bool
pub fn is_prefix_kind(&self) -> bool
Whether this is a prefix-type(module or vtable).
sourcepub fn is_nonzero(&self) -> bool
pub fn is_nonzero(&self) -> bool
Gets whether the type is a NonZero type,
which can be put in an Option
while being ffi-safe.
sourcepub fn get_utypeid(&self) -> UTypeId
pub fn get_utypeid(&self) -> UTypeId
Gets the UTypeId
for the type,
which is an ffi safe equivalent of TypeId
.
sourcepub fn tag(&self) -> &'static Tag
pub fn tag(&self) -> &'static Tag
Gets the Tag
associated with a type,
a JSON-like datastructure which is another way to
check extra properties about a type.
sourcepub const fn mod_refl_mode(&self) -> ModReflMode
pub const fn mod_refl_mode(&self) -> ModReflMode
Gets the ModReflMode
for the type,
whether this is a module whose definition can be reflected on at runtime.
sourcepub fn data(&self) -> TLData
pub fn data(&self) -> TLData
The interior of the type definition, describing whether the type is a primitive/enum/struct/union and its contents.
sourcepub fn data_discriminant(&self) -> TLDataDiscriminant
pub fn data_discriminant(&self) -> TLDataDiscriminant
Describes whether the type is a primitive/enum/struct/union,
every variant corresponds to a TLData
variant of the same name.
sourcepub fn phantom_fields(&self) -> TLFields
pub fn phantom_fields(&self) -> TLFields
Gets the virtual fields that aren’t part of th type definition, but are checked as part of the type
sourcepub fn generics(&self) -> GenericParams
pub fn generics(&self) -> GenericParams
Gets the generic parameters of the type.
sourcepub fn mono_type_layout(&self) -> &MonoTypeLayout
pub fn mono_type_layout(&self) -> &MonoTypeLayout
Gets the parts of the type layout that don’t change with generic parameters.
Trait Implementations
sourceimpl Clone for TypeLayout
impl Clone for TypeLayout
sourcefn clone(&self) -> TypeLayout
fn clone(&self) -> TypeLayout
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for TypeLayout
impl Debug for TypeLayout
sourceimpl Display for TypeLayout
impl Display for TypeLayout
sourceimpl GetStaticEquivalent_ for TypeLayout
impl GetStaticEquivalent_ for TypeLayout
type StaticEquivalent = _static_TypeLayout
sourceimpl PartialEq<TypeLayout> for TypeLayout
impl PartialEq<TypeLayout> for TypeLayout
sourcefn eq(&self, other: &TypeLayout) -> bool
fn eq(&self, other: &TypeLayout) -> bool
sourceimpl StableAbi for TypeLayout
impl StableAbi for TypeLayout
type IsNonZeroType = False
type IsNonZeroType = False
sourceconst LAYOUT: &'static TypeLayout = _
const LAYOUT: &'static TypeLayout = _
sourceconst ABI_CONSTS: AbiConsts = _
const ABI_CONSTS: AbiConsts = _
const
-equivalents of the associated types.impl Copy for TypeLayout
impl Eq for TypeLayout
impl Send for TypeLayout
impl Sync for TypeLayout
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<'a, T> BorrowOwned<'a> for Twhere
T: 'a + Clone,
impl<'a, T> BorrowOwned<'a> for Twhere
T: 'a + Clone,
type ROwned = T
type ROwned = T
RCow::Owned
fn r_borrow(
this: &'a <T as BorrowOwned<'a>>::ROwned
) -> <T as BorrowOwned<'a>>::RBorrowed
fn r_to_owned(
this: <T as BorrowOwned<'a>>::RBorrowed
) -> <T as BorrowOwned<'a>>::ROwned
fn deref_borrowed(this: &<T as BorrowOwned<'a>>::RBorrowed) -> &T
fn deref_owned(this: &<T as BorrowOwned<'a>>::ROwned) -> &T
fn from_cow_borrow(this: &'a T) -> <T as BorrowOwned<'a>>::RBorrowed
fn from_cow_owned(this: <T as ToOwned>::Owned) -> <T as BorrowOwned<'a>>::ROwned
fn into_cow_borrow(this: <T as BorrowOwned<'a>>::RBorrowed) -> &'a T
fn into_cow_owned(this: <T as BorrowOwned<'a>>::ROwned) -> <T as ToOwned>::Owned
sourceimpl<T> GetWithMetadata for T
impl<T> GetWithMetadata for T
type ForSelf = WithMetadata_<T, T>
type ForSelf = WithMetadata_<T, T>
WithMetadata_<Self, Self>
sourceimpl<S> ROExtAcc for S
impl<S> ROExtAcc for S
sourcefn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset
. Read moresourcefn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset
. Read moresourcefn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset
. Read moresourcefn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset
. Read moresourceimpl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
sourcefn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moresourcefn f_swap<F>(&mut self, offset: FieldOffset<S, F, Aligned>, right: &mut S)
fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Aligned>, right: &mut S)
sourcefn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
sourceimpl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
sourcefn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moresourcefn f_swap<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, right: &mut S)
fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, right: &mut S)
sourcefn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
sourceimpl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
sourcefn piped<F, U>(self, f: F) -> Uwhere
F: FnOnce(Self) -> U,
Self: Sized,
fn piped<F, U>(self, f: F) -> Uwhere
F: FnOnce(Self) -> U,
Self: Sized,
sourcefn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read moresourcefn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped
, except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
. Read moresourcefn mutated<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self),
Self: Sized,
fn mutated<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self),
Self: Sized,
sourcefn observe<F>(self, f: F) -> Selfwhere
F: FnOnce(&Self),
Self: Sized,
fn observe<F>(self, f: F) -> Selfwhere
F: FnOnce(&Self),
Self: Sized,
sourcefn as_ref_<T>(&self) -> &Twhere
Self: AsRef<T>,
T: ?Sized,
fn as_ref_<T>(&self) -> &Twhere
Self: AsRef<T>,
T: ?Sized,
AsRef
,
using the turbofish .as_ref_::<_>()
syntax. Read moresourceimpl<This> TransmuteElement for Thiswhere
This: ?Sized,
impl<This> TransmuteElement for Thiswhere
This: ?Sized,
sourceunsafe fn transmute_element<T>(
self
) -> <Self as CanTransmuteElement<T>>::TransmutedPtrwhere
Self: CanTransmuteElement<T>,
unsafe fn transmute_element<T>(
self
) -> <Self as CanTransmuteElement<T>>::TransmutedPtrwhere
Self: CanTransmuteElement<T>,
sourceimpl<T> TypeIdentity for Twhere
T: ?Sized,
impl<T> TypeIdentity for Twhere
T: ?Sized,
type Type = T
type Type = T
Self
.