pub struct RawLateStructDescriptor { /* private fields */ }Expand description
A raw (untyped) descriptor for a LateStruct.
You can obtain a reference to this descriptor using LateStruct::raw_descriptor.
Unlike LateStructDescriptor, the type of the LateStruct to which this descriptor belongs
is erased.
Implementations§
Source§impl RawLateStructDescriptor
impl RawLateStructDescriptor
Sourcepub fn type_name(&self) -> &'static str
pub fn type_name(&self) -> &'static str
Fetches the name of the type for which LateStruct is implemented.
Sourcepub fn type_id(&self) -> TypeId
pub fn type_id(&self) -> TypeId
Fetches the TypeId of the type for which LateStruct is implemented.
Sourcepub fn layout(&self, token: LateLayoutInitToken) -> Layout
pub fn layout(&self, token: LateLayoutInitToken) -> Layout
Fetches the overall layout of the structure generated dynamically for this structure.
Sourcepub fn fields(
&self,
token: LateLayoutInitToken,
) -> &'static [&'static RawLateFieldDescriptor]
pub fn fields( &self, token: LateLayoutInitToken, ) -> &'static [&'static RawLateFieldDescriptor]
Fetches the list of fields contained within this structure.
The order of this list is in no way stable across multiple compilations.
Sourcepub fn typed<S: LateStruct>(&self) -> &LateStructDescriptor<S>
pub fn typed<S: LateStruct>(&self) -> &LateStructDescriptor<S>
Downcasts the descriptor to a typed LateStructDescriptor instance.
S must match the type of the LateStruct marker this descriptor is describing or the
method will panic.
Sourcepub unsafe fn typed_unchecked<S: LateStruct>(&self) -> &LateStructDescriptor<S>
pub unsafe fn typed_unchecked<S: LateStruct>(&self) -> &LateStructDescriptor<S>
Downcasts the descriptor to a typed LateStructDescriptor instance.
This operation can be safely performed with RawLateStructDescriptor::typed.
§Safety
S must match the type of the LateStruct marker this descriptor is describing. Failing
to do so will not cause immediate undefined behavior but could cause latent undefined
behavior if passed to a method expecting the descriptor to belong to a certain
LateStruct type.