pub struct RwLockBellWriteGuard<'a, T> { /* private fields */ }Expand description
RAII write guard for RwLockBell.
Provides exclusive write access to the protected value via Deref and DerefMut.
When dropped, releases the lock and calls all callbacks that were registered via
try_write_or while this guard was held.
Obtained via RwLockBell::write, RwLockBell::try_write, or
RwLockBell::try_write_or.
Implementations§
Source§impl<'a, T> RwLockBellWriteGuard<'a, T>
impl<'a, T> RwLockBellWriteGuard<'a, T>
Sourcepub fn map<U, F>(self, f: F) -> MappedRwLockBellWriteGuard<'a, U>
pub fn map<U, F>(self, f: F) -> MappedRwLockBellWriteGuard<'a, U>
Transforms this guard into a MappedRwLockBellWriteGuard that dereferences
to a subfield of the protected value.
Sourcepub fn try_map<U, F>(
self,
f: F,
) -> Result<MappedRwLockBellWriteGuard<'a, U>, Self>
pub fn try_map<U, F>( self, f: F, ) -> Result<MappedRwLockBellWriteGuard<'a, U>, Self>
Attempts to transform this guard into a MappedRwLockBellWriteGuard.
Returns Err(self) if f returns None, giving the original guard back.
Sourcepub fn try_map_err<U, F, E>(
self,
f: F,
) -> Result<MappedRwLockBellWriteGuard<'a, U>, (Self, E)>
pub fn try_map_err<U, F, E>( self, f: F, ) -> Result<MappedRwLockBellWriteGuard<'a, U>, (Self, E)>
Attempts to transform this guard into a MappedRwLockBellWriteGuard.
Returns Err((self, error)) if f returns Err, giving the original guard
and the error back.
Trait Implementations§
Source§impl<'a, T: Debug> Debug for RwLockBellWriteGuard<'a, T>
impl<'a, T: Debug> Debug for RwLockBellWriteGuard<'a, T>
Source§impl<'a, T> Deref for RwLockBellWriteGuard<'a, T>
impl<'a, T> Deref for RwLockBellWriteGuard<'a, T>
Source§impl<'a, T> DerefMut for RwLockBellWriteGuard<'a, T>
impl<'a, T> DerefMut for RwLockBellWriteGuard<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for RwLockBellWriteGuard<'a, T>
impl<'a, T> !RefUnwindSafe for RwLockBellWriteGuard<'a, T>
impl<'a, T> !Send for RwLockBellWriteGuard<'a, T>
impl<'a, T> Sync for RwLockBellWriteGuard<'a, T>where
T: Sync,
impl<'a, T> Unpin for RwLockBellWriteGuard<'a, T>
impl<'a, T> UnsafeUnpin for RwLockBellWriteGuard<'a, T>
impl<'a, T> !UnwindSafe for RwLockBellWriteGuard<'a, T>
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