Struct vtable::VRefMut [−][src]
#[repr(transparent)]pub struct VRefMut<'a, T: ?Sized + VTableMeta> { /* fields omitted */ }
Expand description
VRefMut<'a MyTraitVTable>
can be thought as a &'a mut dyn MyTrait
It will dereference to a structure that has the same members as MyTrait.
Implementations
Create a new VRef from a mutable reference of a type that can be associated with a VTable.
(the HasStaticVTable
is implemented by the “MyTrait”VTable_static!
macro generated by
the #vtable macro)
Create a new VRefMut from raw pointers
Safety
The ptr
needs to be a valid object fitting the vtable
.
Both vtable and ptr lifetime must outlive ’a.
Can create mutable reference to ptr, so no other code can create mutable reference of ptr
during the life time ’a.
Borrow this to obtain a new VRefMut.
Create a VRef with the same lifetime as the original lifetime.
Return a reference of the given type if the type is matching.