Struct maitake_sync::blocking::RwLockReadGuard
source · pub struct RwLockReadGuard<'lock, T: ?Sized, Lock: RawRwLock = RwSpinlock> { /* private fields */ }
Expand description
An RAII implementation of a “scoped read lock” of a RwLock
. When this
structure is dropped (falls out of scope), the lock will be unlocked.
The data protected by the RwLock
can be immutably accessed through this
guard via its Deref
implementation.
This structure is created by the read
and try_read
methods on
RwLock
.
Trait Implementations§
source§impl<T, R: ?Sized, Lock> AsRef<R> for RwLockReadGuard<'_, T, Lock>
impl<T, R: ?Sized, Lock> AsRef<R> for RwLockReadGuard<'_, T, Lock>
source§impl<T, Lock> Debug for RwLockReadGuard<'_, T, Lock>
impl<T, Lock> Debug for RwLockReadGuard<'_, T, Lock>
source§impl<T, Lock> Display for RwLockReadGuard<'_, T, Lock>
impl<T, Lock> Display for RwLockReadGuard<'_, T, Lock>
impl<T, Lock> Send for RwLockReadGuard<'_, T, Lock>
A RwLockReadGuard
is Send
if both T
and the Lock
type parameter
are Sync
, because sending a RwLockReadGuard
is equivalent to sending a
&(T, Lock)
.
Additionally, the Lock
type’s RawRwLock::GuardMarker
must indicate
that the guard is Send
.
impl<T, Lock> Sync for RwLockReadGuard<'_, T, Lock>
A RwLockReadGuard
is Sync
if both T
and the Lock
type parameter
are Sync
.
Auto Trait Implementations§
impl<'lock, T: ?Sized, Lock> RefUnwindSafe for RwLockReadGuard<'lock, T, Lock>
impl<'lock, T: ?Sized, Lock> Unpin for RwLockReadGuard<'lock, T, Lock>
impl<'lock, T: ?Sized, Lock> UnwindSafe for RwLockReadGuard<'lock, T, Lock>
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