Struct mycelium_util::sync::blocking::RwLockReadGuard
pub struct RwLockReadGuard<'lock, T, Lock = 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§
§impl<T, R, Lock> AsRef<R> for RwLockReadGuard<'_, T, Lock>
impl<T, R, Lock> AsRef<R> for RwLockReadGuard<'_, T, Lock>
§impl<T, Lock> Debug for RwLockReadGuard<'_, T, Lock>
impl<T, Lock> Debug for RwLockReadGuard<'_, T, Lock>
§impl<T, Lock> Deref for RwLockReadGuard<'_, T, Lock>
impl<T, Lock> Deref for RwLockReadGuard<'_, T, Lock>
§impl<T, Lock> Display for RwLockReadGuard<'_, T, Lock>
impl<T, Lock> Display for RwLockReadGuard<'_, T, Lock>
§impl<T, Lock> Drop for RwLockReadGuard<'_, T, Lock>
impl<T, Lock> Drop 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