pub struct Handle<T: ?Sized> { /* private fields */ }
Expand description
Reference-counted async RwLock
Implementations§
Source§impl<T> Handle<T>
impl<T> Handle<T>
Sourcepub async fn read(&self) -> RwLockReadGuard<'_, T>
pub async fn read(&self) -> RwLockReadGuard<'_, T>
Lock the contained value for reading
Sourcepub async fn write(&self) -> RwLockWriteGuard<'_, T>
pub async fn write(&self) -> RwLockWriteGuard<'_, T>
Lock the contained value for writing
pub fn try_unwrap(self) -> Result<T, Self>
Trait Implementations§
impl<T: Send + ?Sized> Send for Handle<T>
impl<T: Send + Sync + ?Sized> Sync for Handle<T>
Auto Trait Implementations§
impl<T> Freeze for Handle<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for Handle<T>
impl<T> Unpin for Handle<T>where
T: ?Sized,
impl<T> !UnwindSafe for Handle<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