pub struct DynDynRef<'a, B: ?Sized + DynDynBase, T: GetDynDynTable<B> + StableDeref>(/* private fields */);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§
Source§impl<'a, B: ?Sized + DynDynBase, T: GetDynDynTable<B> + StableDeref> DynDynRef<'a, B, T>
impl<'a, B: ?Sized + DynDynBase, T: GetDynDynTable<B> + StableDeref> DynDynRef<'a, B, T>
Trait Implementations§
Source§impl<'a, B: ?Sized + DynDynBase, T: DynDyn<'a, B> + StableDeref + 'a> DowncastUnchecked<'a> for DynDynRef<'a, B, T>
impl<'a, B: ?Sized + DynDynBase, T: DynDyn<'a, B> + StableDeref + 'a> DowncastUnchecked<'a> for DynDynRef<'a, B, T>
Source§type DowncastResult<D: ?Sized + 'a> = &'a D
type DowncastResult<D: ?Sized + 'a> = &'a D
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.Source§unsafe fn downcast_unchecked<D: ?Sized + Pointee>(
self,
metadata: <D as Pointee>::Metadata,
) -> Self::DowncastResult<D>
unsafe fn downcast_unchecked<D: ?Sized + Pointee>( self, metadata: <D as Pointee>::Metadata, ) -> Self::DowncastResult<D>
Downcasts this pointer into a new pointer pointing to the same object, but having type
D. Read moreSource§impl<'a, B: ?Sized + DynDynBase, T: GetDynDynTable<B> + StableDeref + 'a> GetDynDynTable<B> for DynDynRef<'a, B, T>
impl<'a, B: ?Sized + DynDynBase, T: GetDynDynTable<B> + StableDeref + 'a> GetDynDynTable<B> for DynDynRef<'a, B, T>
Source§type DynTarget = <T as GetDynDynTable<B>>::DynTarget
type DynTarget = <T as GetDynDynTable<B>>::DynTarget
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.Source§fn get_dyn_dyn_table(&self) -> DynDynTable
fn get_dyn_dyn_table(&self) -> DynDynTable
Gets the
DynDynTable for the object that this pointer points to.Auto Trait Implementations§
impl<'a, B, T> Freeze for DynDynRef<'a, B, T>where
B: ?Sized,
impl<'a, B, T> RefUnwindSafe for DynDynRef<'a, B, T>where
T: RefUnwindSafe,
B: ?Sized,
impl<'a, B, T> Send for DynDynRef<'a, B, T>
impl<'a, B, T> Sync for DynDynRef<'a, B, T>
impl<'a, B, T> Unpin for DynDynRef<'a, B, T>where
B: ?Sized,
impl<'a, B, T> UnwindSafe for DynDynRef<'a, B, T>where
T: RefUnwindSafe,
B: ?Sized,
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