RawLateStructDescriptor

Struct RawLateStructDescriptor 

Source
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

Source

pub fn type_name(&self) -> &'static str

Fetches the name of the type for which LateStruct is implemented.

Source

pub fn type_id(&self) -> TypeId

Fetches the TypeId of the type for which LateStruct is implemented.

Source

pub fn layout(&self, token: LateLayoutInitToken) -> Layout

Fetches the overall layout of the structure generated dynamically for this structure.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for RawLateStructDescriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.