pub struct Lock<T> { /* private fields */ }
Expand description
An asynchronous mutual exclusion primitive useful for protecting shared data
Each mutex has a type parameter (T
) which represents the data that it is protecting. The data
can only be accessed through the RAII guards returned from poll_lock
, which guarantees that
the data is only ever accessed when the mutex is locked.
Implementations§
Trait Implementations§
impl<T> Send for Lock<T>where
T: Send,
impl<T> Sync for Lock<T>where
T: Send,
Auto Trait Implementations§
impl<T> Freeze for Lock<T>
impl<T> !RefUnwindSafe for Lock<T>
impl<T> Unpin for Lock<T>
impl<T> !UnwindSafe for Lock<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)