pub struct DynDynRef<'a, B: ?Sized + DynDynBase, T: GetDynDynTable<B> + StableDeref>(_, _);
Expand description

Wraps a reference to a pointer implementing GetDynDynTable<B> and which can be dereferenced to perform the downcast.

Using dyn_dyn_cast! on this struct will call GetDynDynTable::get_dyn_dyn_table on the pointer itself, then dereference this pointer to perform the downcast. This allows a pointer implementing DynDyn<B> to be downcast into a reference without moving the pointer itself.

Implementations

Creates a new DynDynRef for the provided reference to a pointer.

Trait Implementations

The result of downcasting this pointer to point to the type D. Note that this type need not have the same outer wrapper as the type implementing DowncastUnchecked, since the result of the downcast may involve coercions and dereferences. Read more

Downcasts this pointer into a new pointer pointing to the same object, but having type D. Read more

The actual type that this pointer currently points to. This type is used to allow propagation of auto trait bounds such as Send and Sync in the dyn_dyn_cast! macro. Read more

Gets the DynDynTable for the object that this pointer points to.

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.