#[repr(C)]pub struct VOffset<Base, T: ?Sized + VTableMeta, PinFlag = NotPinned> { /* private fields */ }
Expand description
Represents an offset to a field of type matching the vtable, within the Base container structure.
Implementations§
source§impl<Base, T: ?Sized + VTableMeta, Flag> VOffset<Base, T, Flag>
impl<Base, T: ?Sized + VTableMeta, Flag> VOffset<Base, T, Flag>
sourcepub fn apply(self, base: &Base) -> VRef<'_, T>
pub fn apply(self, base: &Base) -> VRef<'_, T>
Apply this offset to a reference to the base to obtain a VRef
with the same
lifetime as the base lifetime
sourcepub fn apply_mut(self, base: &mut Base) -> VRefMut<'_, T>
pub fn apply_mut(self, base: &mut Base) -> VRefMut<'_, T>
Apply this offset to a reference to the base to obtain a VRefMut
with the same
lifetime as the base lifetime
sourcepub fn new<X: HasStaticVTable<T>>(o: FieldOffset<Base, X, Flag>) -> Self
pub fn new<X: HasStaticVTable<T>>(o: FieldOffset<Base, X, Flag>) -> Self
Create an new VOffset from a FieldOffset
where the target type implement the
HasStaticVTable
trait.
Trait Implementations§
impl<Base, T: ?Sized + VTableMeta, Flag> Copy for VOffset<Base, T, Flag>
Auto Trait Implementations§
impl<Base, T: ?Sized, PinFlag> Freeze for VOffset<Base, T, PinFlag>
impl<Base, T: ?Sized, PinFlag> RefUnwindSafe for VOffset<Base, T, PinFlag>
impl<Base, T: ?Sized, PinFlag> Send for VOffset<Base, T, PinFlag>
impl<Base, T: ?Sized, PinFlag> Sync for VOffset<Base, T, PinFlag>
impl<Base, T: ?Sized, PinFlag> Unpin for VOffset<Base, T, PinFlag>where
PinFlag: Unpin,
impl<Base, T: ?Sized, PinFlag> UnwindSafe for VOffset<Base, T, PinFlag>
Blanket Implementations§
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