Struct yew::platform::pinned::RwLockWriteGuard
pub struct RwLockWriteGuard<'a, T>where
T: ?Sized,{ /* private fields */ }
Expand description
RAII structure used to release the exclusive write access of a lock when dropped.
This structure is created by the write
method on RwLock
.
Implementations§
§impl<'a, T> RwLockWriteGuard<'a, T>where
T: ?Sized,
impl<'a, T> RwLockWriteGuard<'a, T>where
T: ?Sized,
pub fn map<U, F>(this: RwLockWriteGuard<'a, T>, f: F) -> RwLockWriteGuard<'a, U>where
F: FnOnce(&mut T) -> &mut U,
U: ?Sized,
pub fn map<U, F>(this: RwLockWriteGuard<'a, T>, f: F) -> RwLockWriteGuard<'a, U>where
F: FnOnce(&mut T) -> &mut U,
U: ?Sized,
Makes a new RwLockWriteGuard
for a component of the locked data.
This operation cannot fail as data is already locked.
This is an associated function that needs to be used as RwLockWriteGuard::map(...)
. A
method would interfere with methods of the same name on the contents of the underlying data
used through Deref
.
pub fn filter_map<U, F>(
this: RwLockWriteGuard<'a, T>,
f: F
) -> Result<RwLockWriteGuard<'a, U>, RwLockWriteGuard<'a, T>>where
F: FnOnce(&mut T) -> Option<&mut U>,
U: ?Sized,
pub fn filter_map<U, F>(
this: RwLockWriteGuard<'a, T>,
f: F
) -> Result<RwLockWriteGuard<'a, U>, RwLockWriteGuard<'a, T>>where
F: FnOnce(&mut T) -> Option<&mut U>,
U: ?Sized,
Tries to make a new RwLockWriteGuard
for a component of the locked data. Returns the
original write guard if the closure returns None
.
This operation cannot fail as data is already locked.
This is an associated function that needs to be used as RwLockWriteGuard::filter_map(...)
.
A method would interfere with methods of the same name on the contents of the underlying
data used through Deref
.
This function is not available before Rust 1.63.