pub struct MutexWeak<T: ?Sized> { /* private fields */ }Expand description
MutexWeak is a non-owning reference to a Mutex. MutexWeak is to
Mutex as std::sync::Weak is to std::sync::Arc.
§Examples
let mutex = Mutex::<u32>::new(0);
let mutex_weak = Mutex::downgrade(&mutex);
let mutex_new = mutex_weak.upgrade().unwrap();Implementations§
Trait Implementations§
impl<T: ?Sized + Send> Send for MutexWeak<T>
impl<T: ?Sized + Send> Sync for MutexWeak<T>
Auto Trait Implementations§
impl<T> Freeze for MutexWeak<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for MutexWeak<T>
impl<T> Unpin for MutexWeak<T>where
T: ?Sized,
impl<T> !UnwindSafe for MutexWeak<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