#[repr(C)]pub struct PointerDef {
pub vtable: &'static PointerVTable,
pub pointee: Option<&'static Shape>,
pub weak: Option<fn() -> &'static Shape>,
pub strong: Option<&'static Shape>,
pub flags: PointerFlags,
pub known: Option<KnownPointer>,
}Expand description
Describes a pointer — including a vtable to query and alter its state, and the inner shape (the pointee type in the pointer).
Fields§
§vtable: &'static PointerVTablevtable for interacting with the pointer
pointee: Option<&'static Shape>shape of the inner type of the pointer, if not opaque
weak: Option<fn() -> &'static Shape>shape of the corresponding strong pointer, if this pointer is weak
the layer of indirection is to break the strong <-> weak reference cycle, since consts may not have cycles in their definitions.
strong: Option<&'static Shape>shape of the corresponding weak pointer, if this pointer is strong
flags: PointerFlagsFlags representing various characteristics of the pointer
known: Option<KnownPointer>An optional field to identify the kind of pointer
Implementations§
Source§impl PointerDef
impl PointerDef
Sourcepub const fn builder() -> PointerDefBuilder
pub const fn builder() -> PointerDefBuilder
Creates a new PointerDefBuilder with all fields set to None.
Sourcepub fn pointee(&self) -> Option<&'static Shape>
pub fn pointee(&self) -> Option<&'static Shape>
Returns shape of the inner type of the pointer, if not opaque
Sourcepub fn weak(&self) -> Option<&'static Shape>
pub fn weak(&self) -> Option<&'static Shape>
Returns shape of the corresponding strong pointer, if this pointer is weak
Sourcepub fn strong(&self) -> Option<&'static Shape>
pub fn strong(&self) -> Option<&'static Shape>
Returns shape of the corresponding weak pointer, if this pointer is strong
Sourcepub const fn constructible_from_pointee(&self) -> bool
pub const fn constructible_from_pointee(&self) -> bool
Whether a new pointer can be constructed from an owned value of its pointee type.
Trait Implementations§
Source§impl Clone for PointerDef
impl Clone for PointerDef
Source§fn clone(&self) -> PointerDef
fn clone(&self) -> PointerDef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more