#[repr(transparent)]
pub struct VRefMut<'a, T: ?Sized + VTableMeta> { /* private fields */ }
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 VRef.

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.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.