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