pub struct RwLockReadGuard<'a, T: ?Sized> { /* private fields */ }Expand description
Shared access to a RwLock’s value, or to a component of it; releases
on drop.
The release is one atomic read-modify-write when no waiter needs telling. Otherwise it is lock-free, not wait-free: it returns after one pass over the queue, plus at most one for each operation of another thread that lands on the queue meanwhile (see Progress).
Implementations§
Source§impl<'a, T: ?Sized> RwLockReadGuard<'a, T>
impl<'a, T: ?Sized> RwLockReadGuard<'a, T>
Sourcepub fn map<F, U>(this: Self, f: F) -> RwLockReadGuard<'a, U>
pub fn map<F, U>(this: Self, f: F) -> RwLockReadGuard<'a, U>
A guard for a component of the locked data. It cannot fail: this guard already holds a read.
An associated function, RwLockReadGuard::map(guard, f): a method
would shadow methods of the locked data.
Trait Implementations§
Source§impl<T: ?Sized> Deref for RwLockReadGuard<'_, T>
impl<T: ?Sized> Deref for RwLockReadGuard<'_, T>
Source§impl<T: ?Sized> Drop for RwLockReadGuard<'_, T>
impl<T: ?Sized> Drop for RwLockReadGuard<'_, T>
impl<T: ?Sized + Sync> Send for RwLockReadGuard<'_, T>
impl<T: ?Sized + Send + Sync> Sync for RwLockReadGuard<'_, T>
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for RwLockReadGuard<'a, T>
impl<'a, T> !UnwindSafe for RwLockReadGuard<'a, T>
impl<'a, T> Freeze for RwLockReadGuard<'a, T>where
T: ?Sized,
impl<'a, T> Unpin for RwLockReadGuard<'a, T>where
T: ?Sized,
impl<'a, T> UnsafeUnpin for RwLockReadGuard<'a, T>where
T: ?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