Struct diem_infallible::RwLock
source · pub struct RwLock<T>(/* private fields */);
Expand description
A simple wrapper around the lock() function of a std::sync::RwLock The only difference is that you don’t need to call unwrap() on it.
Implementations§
source§impl<T> RwLock<T>
impl<T> RwLock<T>
sourcepub fn read(&self) -> RwLockReadGuard<'_, T>
pub fn read(&self) -> RwLockReadGuard<'_, T>
lock the rwlock in read mode
sourcepub fn write(&self) -> RwLockWriteGuard<'_, T>
pub fn write(&self) -> RwLockWriteGuard<'_, T>
lock the rwlock in write mode
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
return the owned type consuming the lock
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for RwLock<T>
impl<T> Send for RwLock<T>where
T: Send,
impl<T> Sync for RwLock<T>
impl<T> Unpin for RwLock<T>where
T: Unpin,
impl<T> UnwindSafe for RwLock<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