Struct shared_mutex::MappedSharedMutexReadGuard
[−]
[src]
pub struct MappedSharedMutexReadGuard<'mutex, T: ?Sized + 'mutex> { /* fields omitted */ }
A read guard to a sub-borrow of an original SharedMutexReadGuard.
Unlike SharedMutexReadGuard, it cannot be used to wait on a
Condvar
.
Methods
impl<'mutex, T: ?Sized> MappedSharedMutexReadGuard<'mutex, T>
[src]
fn map<U: ?Sized, F>(self, action: F) -> MappedSharedMutexReadGuard<'mutex, U> where
F: FnOnce(&T) -> &U,
F: FnOnce(&T) -> &U,
Transform this guard into a sub-borrow of the original data.
fn option_map<U: ?Sized, F>(
self,
action: F
) -> Option<MappedSharedMutexReadGuard<'mutex, U>> where
F: FnOnce(&T) -> Option<&U>,
self,
action: F
) -> Option<MappedSharedMutexReadGuard<'mutex, U>> where
F: FnOnce(&T) -> Option<&U>,
Conditionally transform this guard into a sub-borrow of the original data.
fn result_map<U: ?Sized, E, F>(
self,
action: F
) -> Result<MappedSharedMutexReadGuard<'mutex, U>, (Self, E)> where
F: FnOnce(&T) -> Result<&U, E>,
self,
action: F
) -> Result<MappedSharedMutexReadGuard<'mutex, U>, (Self, E)> where
F: FnOnce(&T) -> Result<&U, E>,
Conditionally transform this guard into a sub-borrow of the original data.
If the transformation operation is aborted, returns the original guard.
fn recover<U: ?Sized>(
self,
mutex: &'mutex SharedMutex<U>
) -> Result<SharedMutexReadGuard<'mutex, U>, Self>
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
impl<'mutex, T: ?Sized> Deref for MappedSharedMutexReadGuard<'mutex, T>
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value