pub struct RwLock<T> { /* private fields */ }Expand description
Async-aware RwLock
Implementations§
Source§impl<T> RwLock<T>
impl<T> RwLock<T>
Sourcepub fn read(&self) -> RwLockReadFuture<'_, T> ⓘ
pub fn read(&self) -> RwLockReadFuture<'_, T> ⓘ
Acquire a read lock asynchronously
Sourcepub fn write(&self) -> RwLockWriteFuture<'_, T> ⓘ
pub fn write(&self) -> RwLockWriteFuture<'_, T> ⓘ
Acquire a write lock asynchronously
Sourcepub fn try_read(&self) -> Option<RwLockReadGuard<'_, T>>
pub fn try_read(&self) -> Option<RwLockReadGuard<'_, T>>
Try to acquire a read lock immediately
Sourcepub fn try_write(&self) -> Option<RwLockWriteGuard<'_, T>>
pub fn try_write(&self) -> Option<RwLockWriteGuard<'_, T>>
Try to acquire a write lock immediately
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RwLock<T>
impl<T> !RefUnwindSafe for RwLock<T>
impl<T> Unpin for RwLock<T>where
UnsafeCell<T>: Unpin,
impl<T> UnsafeUnpin for RwLock<T>where
UnsafeCell<T>: UnsafeUnpin,
impl<T> UnwindSafe for RwLock<T>where
UnsafeCell<T>: UnwindSafe,
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