#[repr(C)]pub struct TypeDesc {
kind: TypeKind,
children: Slice<&'static TypeDesc>,
}Expand description
A type, as a compiled program describes it. Struct types may lead back to themselves through their fields, so these form a graph of statics.
Fields§
§kind: TypeKind§children: Slice<&'static TypeDesc>Implementations§
Source§impl TypeDesc
impl TypeDesc
Sourcepub const KIND_OFFSET: usize
pub const KIND_OFFSET: usize
Where the kind and the children sit, for code that emits types as data.
pub const CHILDREN_OFFSET: usize
pub(crate) const fn scalar(kind: TypeKind) -> Self
pub const fn list(element: &'static [&'static Self; 1]) -> Self
pub const fn structure(fields: &'static [&'static Self]) -> Self
pub fn kind(&self) -> TypeKind
Sourcepub fn children(&self) -> &'static [&'static Self]
pub fn children(&self) -> &'static [&'static Self]
The element type of a list, or the field types of a struct.
fn element(&self) -> &'static Self
fn is_object(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Send for TypeDesc
impl Freeze for TypeDesc
impl RefUnwindSafe for TypeDesc
impl Sync for TypeDesc
impl Unpin for TypeDesc
impl UnsafeUnpin for TypeDesc
impl UnwindSafe for TypeDesc
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
Mutably borrows from an owned value. Read more