Struct yew::platform::pinned::RwLockReadGuard
pub struct RwLockReadGuard<'a, T>where
T: ?Sized,{ /* private fields */ }
Expand description
RAII structure used to release the shared read access of a lock when dropped.
This structure is created by the read
method on RwLock
.
Implementations§
§impl<'a, T> RwLockReadGuard<'a, T>where
T: ?Sized,
impl<'a, T> RwLockReadGuard<'a, T>where
T: ?Sized,
pub fn map<U, F>(this: RwLockReadGuard<'a, T>, f: F) -> RwLockReadGuard<'a, U>where
F: FnOnce(&T) -> &U,
U: ?Sized,
pub fn map<U, F>(this: RwLockReadGuard<'a, T>, f: F) -> RwLockReadGuard<'a, U>where
F: FnOnce(&T) -> &U,
U: ?Sized,
Makes a new RwLockReadGuard
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 RwLockReadGuard::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: RwLockReadGuard<'a, T>,
f: F
) -> Result<RwLockReadGuard<'a, U>, RwLockReadGuard<'a, T>>where
F: FnOnce(&T) -> Option<&U>,
U: ?Sized,
pub fn filter_map<U, F>(
this: RwLockReadGuard<'a, T>,
f: F
) -> Result<RwLockReadGuard<'a, U>, RwLockReadGuard<'a, T>>where
F: FnOnce(&T) -> Option<&U>,
U: ?Sized,
Tries to make a new RwLockReadGuard
for a component of the locked data. Returns the
original read 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 RwLockReadGuard::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.