pub struct RwLockReadGuard<'rwlock, T>where
T: 'rwlock + ?Sized,{ /* private fields */ }nonpoison_rwlock)Expand description
Implementations§
Source§impl<'rwlock, T> RwLockReadGuard<'rwlock, T>where
T: ?Sized,
impl<'rwlock, T> RwLockReadGuard<'rwlock, T>where
T: ?Sized,
Sourcepub fn map<U, F>(
orig: RwLockReadGuard<'rwlock, T>,
f: F,
) -> MappedRwLockReadGuard<'rwlock, U>
🔬This is a nightly-only experimental API. (mapped_lock_guards)
pub fn map<U, F>( orig: RwLockReadGuard<'rwlock, T>, f: F, ) -> MappedRwLockReadGuard<'rwlock, U>
mapped_lock_guards)Makes a MappedRwLockReadGuard for a component of the borrowed data, e.g.
an enum variant.
The RwLock is already locked for reading, so this cannot fail.
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 RwLockReadGuard used through
Deref.
§Panics
If the closure panics, the guard will be dropped (unlocked).
Sourcepub fn filter_map<U, F>(
orig: RwLockReadGuard<'rwlock, T>,
f: F,
) -> Result<MappedRwLockReadGuard<'rwlock, U>, RwLockReadGuard<'rwlock, T>>
🔬This is a nightly-only experimental API. (mapped_lock_guards)
pub fn filter_map<U, F>( orig: RwLockReadGuard<'rwlock, T>, f: F, ) -> Result<MappedRwLockReadGuard<'rwlock, U>, RwLockReadGuard<'rwlock, T>>
mapped_lock_guards)Makes a MappedRwLockReadGuard for a component of the borrowed data. The
original guard is returned as an Err(...) if the closure returns
None.
The RwLock is already locked for reading, so this cannot fail.
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 RwLockReadGuard used through
Deref.
§Panics
If the closure panics, the guard will be dropped (unlocked).
Trait Implementations§
Source§impl<T> Debug for RwLockReadGuard<'_, T>
impl<T> Debug for RwLockReadGuard<'_, T>
Source§impl<T> Deref for RwLockReadGuard<'_, T>where
T: ?Sized,
impl<T> Deref for RwLockReadGuard<'_, T>where
T: ?Sized,
Source§impl<T> Display for RwLockReadGuard<'_, T>
impl<T> Display for RwLockReadGuard<'_, T>
Source§impl<T> Drop for RwLockReadGuard<'_, T>where
T: ?Sized,
impl<T> Drop for RwLockReadGuard<'_, T>where
T: ?Sized,
impl<T> !Send for RwLockReadGuard<'_, T>where
T: ?Sized,
impl<T> Sync for RwLockReadGuard<'_, T>
Auto Trait Implementations§
impl<'rwlock, T> Freeze for RwLockReadGuard<'rwlock, T>where
T: ?Sized,
impl<'rwlock, T> RefUnwindSafe for RwLockReadGuard<'rwlock, T>where
T: RefUnwindSafe + ?Sized,
impl<'rwlock, T> Unpin for RwLockReadGuard<'rwlock, T>where
T: ?Sized,
impl<'rwlock, T> UnwindSafe for RwLockReadGuard<'rwlock, T>where
T: RefUnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
Access::load.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Source for T
impl<T> Source for T
Source§type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a>
where
T: 'a
type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a> where T: 'a
Source can be sliced into.Source§fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>where
Chunk: Chunk<'a>,
fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>where
Chunk: Chunk<'a>,
None when reading
out of bounds would occur. Read moreSource§unsafe fn read_byte_unchecked(&self, offset: usize) -> u8
unsafe fn read_byte_unchecked(&self, offset: usize) -> u8
Source§fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>
fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>
slice::get(range). Read moreSource§unsafe fn slice_unchecked(
&self,
range: Range<usize>,
) -> <T as Source>::Slice<'_>
unsafe fn slice_unchecked( &self, range: Range<usize>, ) -> <T as Source>::Slice<'_>
slice::get_unchecked(range). Read more