pub struct RwLock<T: ?Sized>(/* private fields */);
Expand description
Provides interior mutability.
This is a thin wrapper around parking_lot::RwLock
, except if
the feature deadlock_detection
is turned enabled, in which case
extra checks are added to detect deadlocks.
Implementations§
Source§impl<T: ?Sized> RwLock<T>
impl<T: ?Sized> RwLock<T>
pub fn read(&self) -> RwLockReadGuard<'_, T>
pub fn write(&self) -> RwLockWriteGuard<'_, T>
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RwLock<T>
impl<T> !RefUnwindSafe for RwLock<T>
impl<T> Send for RwLock<T>
impl<T> Sync for RwLock<T>
impl<T> Unpin for RwLock<T>
impl<T> UnwindSafe for RwLock<T>where
T: UnwindSafe + ?Sized,
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