pub struct RwLockReadGuard<'rwlock, T: ?Sized + 'rwlock> {/* private fields */ }Expand description
Implementations§
Source§impl<'rwlock, T: ?Sized>RwLockReadGuard<'rwlock, T>
impl<'rwlock, T: ?Sized>RwLockReadGuard<'rwlock, T>
Sourcepub fnmap<U, F>(orig: Self, f: F) ->MappedRwLockReadGuard<'rwlock, U>
🔬This is a nightly-only experimental API. (mapped_lock_guards #117108)
pub fnmap<U, F>(orig: Self, f: F) ->MappedRwLockReadGuard<'rwlock, U>
mapped_lock_guards #117108)Makes aMappedRwLockReadGuard for a component of the borrowed data, e.g.an enum variant.
TheRwLock is already locked for reading, so this cannot fail.
This is an associated function that needs to be used asRwLockReadGuard::map(...). A method would interfere with methods ofthe same name on the contents of theRwLockReadGuard used throughDeref.
§Panics
If the closure panics, the guard will be dropped (unlocked) and the RwLock will not bepoisoned.
Sourcepub fnfilter_map<U, F>( orig: Self, f: F,) ->Result<MappedRwLockReadGuard<'rwlock, U>, Self>
🔬This is a nightly-only experimental API. (mapped_lock_guards #117108)
pub fnfilter_map<U, F>( orig: Self, f: F,) ->Result<MappedRwLockReadGuard<'rwlock, U>, Self>
mapped_lock_guards #117108)Makes aMappedRwLockReadGuard for a component of the borrowed data. Theoriginal guard is returned as anErr(...) if the closure returnsNone.
TheRwLock is already locked for reading, so this cannot fail.
This is an associated function that needs to be used asRwLockReadGuard::filter_map(...). A method would interfere with methodsof the same name on the contents of theRwLockReadGuard used throughDeref.
§Panics
If the closure panics, the guard will be dropped (unlocked) and the RwLock will not bepoisoned.