pub struct ReadGuard<'a, V> { /* private fields */ }Expand description
An RAII read guard returned by the get methods of the synchronous
containers (SyncHashMap, SyncBtreeMap, SyncVec, SyncIndexMap).
Reading the value is lock-free and contention-free: the guard only holds a
reader slot in the calling thread’s private counter (writers wait for all
threads’ counters to drain before mutating), so the pointed-to value can
never be invalidated or raced while the guard is alive. It is not Send:
it must be dropped on the same thread that created it.
Trait Implementations§
impl<'a, V: Eq> Eq for ReadGuard<'a, V>
Auto Trait Implementations§
impl<'a, V> !Send for ReadGuard<'a, V>
impl<'a, V> !Sync for ReadGuard<'a, V>
impl<'a, V> Freeze for ReadGuard<'a, V>
impl<'a, V> RefUnwindSafe for ReadGuard<'a, V>where
V: RefUnwindSafe,
impl<'a, V> Unpin for ReadGuard<'a, V>
impl<'a, V> UnsafeUnpin for ReadGuard<'a, V>
impl<'a, V> UnwindSafe for ReadGuard<'a, V>where
V: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.