pub struct RefGuard<T> { /* private fields */ }Expand description
Weak guard for acquiring read only access to a ValueGuard’s value.
§Safety
This struct must not be leaked to the stack using mem::forget or any
other mechanism that causes the contents of Self to be overwritten
without Drop::drop() running.
Doing so creates unsoundness that likely will lead to dereferencing a null
pointer.
Note that it is sound to leak Self to the heap using methods including
Box::leak() because heap allocated data will never be overwritten if it
is never freed.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RefGuard<T>
impl<T> !RefUnwindSafe for RefGuard<T>
impl<T> !Send for RefGuard<T>
impl<T> !Sync for RefGuard<T>
impl<T> !Unpin for RefGuard<T>
impl<T> !UnsafeUnpin for RefGuard<T>
impl<T> !UnwindSafe for RefGuard<T>
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