[−][src]Trait vptr::HasVPtr
This trait indicate that the type has a VPtr field to the trait Trait
You should not implement this trait yourself, it is implemented by the vptr
macro
Safety: For this to work correctly, the init() function must return a reference to a VTableData with valid content (the offset and vtable pointer need to be correct for this type) and get_vptr must return a reference of a field withi &self. The `#[vptr] macro does the right thing
Required methods
fn init() -> &'static VTableData
Initialize a VTableData suitable to initialize the VPtr within Self
fn get_vptr(&self) -> &VPtr<Self, Trait> where
Self: Sized,
Self: Sized,
return the a reference of the VPtr within Self
fn get_vptr_mut(&mut self) -> &mut VPtr<Self, Trait> where
Self: Sized,
Self: Sized,
return the a reference of the VPtr within Self
Provided methods
fn as_thin_ref(&self) -> ThinRef<Trait> where
Self: Sized,
Self: Sized,
return a thin reference to self
fn as_thin_ref_mut(&mut self) -> ThinRefMut<Trait> where
Self: Sized,
Self: Sized,
return a thin reference to self
fn as_pin_thin_ref(self: Pin<&Self>) -> Pin<ThinRef<Trait>> where
Self: Sized,
Self: Sized,
Map a pinned reference to to a pinned thin reference
fn as_pin_thin_ref_mut(self: Pin<&mut Self>) -> Pin<ThinRefMut<Trait>> where
Self: Sized,
Self: Sized,
Map a pinned mutable reference to to a pinned mutable thin reference