pub struct ArcRwLockReadGuard<R, T>{ /* private fields */ }Expand description
An RAII rwlock guard returned by the Arc locking operations on RwLock.
This is similar to the RwLockReadGuard struct, except instead of using a reference to unlock the RwLock
it uses an Arc<RwLock>. This has several advantages, most notably that it has an 'static lifetime.
Implementations§
Source§impl<R, T> ArcRwLockReadGuard<R, T>
impl<R, T> ArcRwLockReadGuard<R, T>
Sourcepub fn rwlock(s: &ArcRwLockReadGuard<R, T>) -> &Arc<RwLock<R, T>>
pub fn rwlock(s: &ArcRwLockReadGuard<R, T>) -> &Arc<RwLock<R, T>>
Returns a reference to the rwlock, contained in its Arc.
Sourcepub fn into_arc(s: ArcRwLockReadGuard<R, T>) -> Arc<RwLock<R, T>>
pub fn into_arc(s: ArcRwLockReadGuard<R, T>) -> Arc<RwLock<R, T>>
Unlocks the RwLock and returns the Arc that was held by the ArcRwLockReadGuard.
Sourcepub fn unlocked<F, U>(s: &mut ArcRwLockReadGuard<R, T>, f: F) -> Uwhere
F: FnOnce() -> U,
pub fn unlocked<F, U>(s: &mut ArcRwLockReadGuard<R, T>, f: F) -> Uwhere
F: FnOnce() -> U,
Temporarily unlocks the RwLock to execute the given function.
This is functionally identical to the unlocked method on RwLockReadGuard.
Source§impl<R, T> ArcRwLockReadGuard<R, T>where
R: RawRwLockFair,
T: ?Sized,
impl<R, T> ArcRwLockReadGuard<R, T>where
R: RawRwLockFair,
T: ?Sized,
Sourcepub fn unlock_fair(s: ArcRwLockReadGuard<R, T>)
pub fn unlock_fair(s: ArcRwLockReadGuard<R, T>)
Unlocks the RwLock using a fair unlock protocol.
This is functionally identical to the unlock_fair method on RwLockReadGuard.
Sourcepub fn into_arc_fair(s: ArcRwLockReadGuard<R, T>) -> Arc<RwLock<R, T>>
pub fn into_arc_fair(s: ArcRwLockReadGuard<R, T>) -> Arc<RwLock<R, T>>
Unlocks the RwLock using a fair unlock protocol and returns the Arc that was held by the ArcRwLockReadGuard.
Sourcepub fn unlocked_fair<F, U>(s: &mut ArcRwLockReadGuard<R, T>, f: F) -> Uwhere
F: FnOnce() -> U,
pub fn unlocked_fair<F, U>(s: &mut ArcRwLockReadGuard<R, T>, f: F) -> Uwhere
F: FnOnce() -> U,
Temporarily unlocks the RwLock to execute the given function.
This is functionally identical to the unlocked_fair method on RwLockReadGuard.
Sourcepub fn bump(s: &mut ArcRwLockReadGuard<R, T>)
pub fn bump(s: &mut ArcRwLockReadGuard<R, T>)
Temporarily yields the RwLock to a waiting thread if there is one.
This is functionally identical to the bump method on RwLockReadGuard.