pub struct RwLock<T: ?Sized> { /* private fields */ }
Expand description
A reader-writer lock
The priority policy of the lock is that readers have weak priority
Implementations§
source§impl<T: ?Sized> RwLock<T>
impl<T: ?Sized> RwLock<T>
pub fn read(&self) -> LockResult<RwLockReadGuard<'_, T>>
pub fn try_read(&self) -> TryLockResult<RwLockReadGuard<'_, T>>
pub fn write(&self) -> LockResult<RwLockWriteGuard<'_, T>>
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<'_, T>>
pub fn is_poisoned(&self) -> bool
pub fn into_inner(self) -> LockResult<T>where
T: Sized,
pub fn get_mut(&mut self) -> LockResult<&mut T>
Trait Implementations§
impl<T: ?Sized> RefUnwindSafe for RwLock<T>
impl<T: ?Sized + Send + Sync> Send for RwLock<T>
impl<T: ?Sized + Send + Sync> Sync for RwLock<T>
impl<T: ?Sized> UnwindSafe for RwLock<T>
Auto Trait Implementations§
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