pub struct MappedSharedMutexReadGuard<'mutex, T: ?Sized + 'mutex> { /* private fields */ }
Expand description
A read guard to a sub-borrow of an original SharedMutexReadGuard.
Unlike SharedMutexReadGuard, it cannot be used to wait on a
Condvar
.
Implementations§
Sourcepub fn map<U: ?Sized, F>(
self,
action: F,
) -> MappedSharedMutexReadGuard<'mutex, U>
pub fn map<U: ?Sized, F>( self, action: F, ) -> MappedSharedMutexReadGuard<'mutex, U>
Transform this guard into a sub-borrow of the original data.
Sourcepub fn option_map<U: ?Sized, F>(
self,
action: F,
) -> Option<MappedSharedMutexReadGuard<'mutex, U>>
pub fn option_map<U: ?Sized, F>( self, action: F, ) -> Option<MappedSharedMutexReadGuard<'mutex, U>>
Conditionally transform this guard into a sub-borrow of the original data.
Sourcepub fn result_map<U: ?Sized, E, F>(
self,
action: F,
) -> Result<MappedSharedMutexReadGuard<'mutex, U>, (Self, E)>
pub fn result_map<U: ?Sized, E, F>( self, action: F, ) -> Result<MappedSharedMutexReadGuard<'mutex, U>, (Self, E)>
Conditionally transform this guard into a sub-borrow of the original data.
If the transformation operation is aborted, returns the original guard.
Sourcepub fn recover<U: ?Sized>(
self,
mutex: &'mutex SharedMutex<U>,
) -> Result<SharedMutexReadGuard<'mutex, U>, Self>
pub fn recover<U: ?Sized>( self, mutex: &'mutex SharedMutex<U>, ) -> Result<SharedMutexReadGuard<'mutex, U>, Self>
Recover the original guard for waiting.
Takes the original mutex to recover the original type and data. If the
passed mutex is not the same object as the original mutex, returns Err
.
Trait Implementations§
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