#[repr(C)]pub struct RefDyn<'a, Vtable: 'static> { /* private fields */ }Implementations§
Source§impl<'a, Vtable: 'static> RefDyn<'a, Vtable>
impl<'a, Vtable: 'static> RefDyn<'a, Vtable>
pub const fn new<T>(value: &'a T) -> Selfwhere
Vtable: VtableFor<T>,
Sourcepub const unsafe fn from_ptr_vtable_unchecked(
ptr: NonNull<()>,
vtable: &'static Vtable,
) -> Self
pub const unsafe fn from_ptr_vtable_unchecked( ptr: NonNull<()>, vtable: &'static Vtable, ) -> Self
§Safety
ptr must be valid to use with vtable
Sourcepub const unsafe fn get_unchecked<T>(&self) -> &T
pub const unsafe fn get_unchecked<T>(&self) -> &T
§Safety
ptr must point to a valid T
Sourcepub const unsafe fn get_mut_unchecked<T>(&mut self) -> &mut T
pub const unsafe fn get_mut_unchecked<T>(&mut self) -> &mut T
§Safety
ptr must point to a valid T
pub const fn vtable(&self) -> &'static Vtable
pub const fn as_ptr(&self) -> NonNull<()>
Auto Trait Implementations§
impl<'a, Vtable> Freeze for RefDyn<'a, Vtable>
impl<'a, Vtable> RefUnwindSafe for RefDyn<'a, Vtable>where
Vtable: RefUnwindSafe,
impl<'a, Vtable> !Send for RefDyn<'a, Vtable>
impl<'a, Vtable> !Sync for RefDyn<'a, Vtable>
impl<'a, Vtable> Unpin for RefDyn<'a, Vtable>
impl<'a, Vtable> UnwindSafe for RefDyn<'a, Vtable>where
Vtable: RefUnwindSafe,
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