pub struct SharedMutexReadGuard<'mutex, T: ?Sized + 'mutex> { /* private fields */ }
Expand description
A shared read guard on a SharedMutex.
Implementations§
Sourcepub fn into_mapped(self) -> MappedSharedMutexReadGuard<'mutex, T>
pub fn into_mapped(self) -> MappedSharedMutexReadGuard<'mutex, T>
Turn this guard into a guard which can be mapped to a sub-borrow.
Note that a mapped guard cannot wait on a Condvar
.
Sourcepub fn wait_for_write(
self,
cond: &Condvar,
) -> LockResult<SharedMutexWriteGuard<'mutex, T>>
pub fn wait_for_write( self, cond: &Condvar, ) -> LockResult<SharedMutexWriteGuard<'mutex, T>>
Wait on the given condition variable, and resume with a write lock.
See the documentation for std::sync::Condvar::wait
for more information.
Sourcepub fn wait_for_read(self, cond: &Condvar) -> LockResult<Self>
pub fn wait_for_read(self, cond: &Condvar) -> LockResult<Self>
Wait on the given condition variable, and resume with another read lock.
See the documentation for std::sync::Condvar::wait
for more information.
Trait Implementations§
Source§fn into(self) -> SharedMutexReadGuard<'mutex, T>
fn into(self) -> SharedMutexReadGuard<'mutex, T>
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
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