pub struct WriteRef<'a, T: 'a>(_);
Expand description
Represents a write-only reference.
It is generally advised to take an impl Into<WriteRef>
instead of a
WriteRef
itself in APIs so that callers can pass in a mutable reference.
Examples
let mut a = 3;
{
let mut a_ref = WriteRef::from(&mut a);
a_ref.write(0);
}
assert_eq!(a, 0);
Implementations
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for WriteRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for WriteRef<'a, T>where
T: Send,
impl<'a, T> Sync for WriteRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for WriteRef<'a, T>
impl<'a, T> !UnwindSafe for WriteRef<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more