#[repr(C)]pub struct TypeLayout { /* private fields */ }Expand description
The layout of a type, also includes metadata about where the type was defined.
Implementations§
Source§impl 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<ExtraChecks_TO<RRef<'static, ()>>>
pub fn extra_checks(&self) -> Option<ExtraChecks_TO<RRef<'static, ()>>>
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§
Source§impl Clone for TypeLayout
impl Clone for TypeLayout
Source§fn clone(&self) -> TypeLayout
fn clone(&self) -> TypeLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TypeLayout
impl Debug for TypeLayout
Source§impl Display for TypeLayout
impl Display for TypeLayout
Source§impl GetStaticEquivalent_ for TypeLayout
impl GetStaticEquivalent_ for TypeLayout
type StaticEquivalent = _static_TypeLayout
Source§impl PartialEq for TypeLayout
impl PartialEq for TypeLayout
Source§impl StableAbi for TypeLayout
impl StableAbi for TypeLayout
Source§const LAYOUT: &'static TypeLayout
const LAYOUT: &'static TypeLayout
Source§type IsNonZeroType = False
type IsNonZeroType = False
Source§const 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§
impl Freeze for TypeLayout
impl RefUnwindSafe for TypeLayout
impl Unpin for TypeLayout
impl UnwindSafe for TypeLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<'a, T> BorrowOwned<'a> for Twhere
T: 'a + Clone,
impl<'a, T> BorrowOwned<'a> for Twhere
T: 'a + Clone,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetWithMetadata for T
impl<T> GetWithMetadata for T
Source§type ForSelf = WithMetadata_<T, T>
type ForSelf = WithMetadata_<T, T>
WithMetadata_<Self, Self>Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset. Read moreSource§fn 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 moreSource§fn 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 moreSource§fn 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 moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn 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 moreSource§fn 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,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn 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 moreSource§fn 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,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn 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 moreSource§fn 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.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef,
using the turbofish .as_ref_::<_>() syntax. Read more