#[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
sourceimpl<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
sourceimpl<Base, T: ?Sized + VTableMeta, Flag> Clone for VOffset<Base, T, Flag>
impl<Base, T: ?Sized + VTableMeta, Flag> Clone for VOffset<Base, T, Flag>
sourceimpl<Base, T: ?Sized + VTableMeta, PinFlag> Debug for VOffset<Base, T, PinFlag>
impl<Base, T: ?Sized + VTableMeta, PinFlag> Debug for VOffset<Base, T, PinFlag>
impl<Base, T: ?Sized + VTableMeta, Flag> Copy for VOffset<Base, T, Flag>
Auto Trait Implementations
impl<Base, T: ?Sized, PinFlag> RefUnwindSafe for VOffset<Base, T, PinFlag> where
PinFlag: RefUnwindSafe,
<T as VTableMeta>::VTable: RefUnwindSafe,
impl<Base, T: ?Sized, PinFlag> Send for VOffset<Base, T, PinFlag> where
PinFlag: Send,
<T as VTableMeta>::VTable: Sync,
impl<Base, T: ?Sized, PinFlag> Sync for VOffset<Base, T, PinFlag> where
PinFlag: Sync,
<T as VTableMeta>::VTable: Sync,
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> where
PinFlag: UnwindSafe,
<T as VTableMeta>::VTable: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more