Struct 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>
pub fn map<U, F>(this: RwLockReadGuard<'a, T>, f: F) -> RwLockReadGuard<'a, U>
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>>
pub fn filter_map<U, F>( this: RwLockReadGuard<'a, T>, f: F, ) -> Result<RwLockReadGuard<'a, U>, RwLockReadGuard<'a, T>>
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.
Trait Implementations§
§impl<'a, T> Debug for RwLockReadGuard<'a, T>
impl<'a, T> Debug for RwLockReadGuard<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for RwLockReadGuard<'a, T>where
T: ?Sized,
impl<'a, T> !RefUnwindSafe for RwLockReadGuard<'a, T>
impl<'a, T> !Send for RwLockReadGuard<'a, T>
impl<'a, T> !Sync for RwLockReadGuard<'a, T>
impl<'a, T> Unpin for RwLockReadGuard<'a, T>where
T: ?Sized,
impl<'a, T> !UnwindSafe for RwLockReadGuard<'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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self
to a value of a Properties
struct.