pub struct LrMap<K: Eq + Hash + Clone, V: Clone> { /* private fields */ }Expand description
A concurrent map optimized for read-heavy workloads.
Readers never block — not even while a write is in progress. Writers are
serialized through an internal Mutex.
Trade-off: doubled memory (two copies of the map).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<K, V> !Freeze for LrMap<K, V>
impl<K, V> Forget for LrMap<K, V>
impl<K, V> Move for LrMap<K, V>
impl<K, V> RefUnwindSafe for LrMap<K, V>where
Atomic<usize>: RefUnwindSafe,
Atomic<*mut HashMap<K, V>>: RefUnwindSafe,
Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>: RefUnwindSafe,
Mutex<WriteHandle<HashMap<K, V>, MapOp<K, V>>>: RefUnwindSafe,
impl<K, V> Send for LrMap<K, V>
impl<K, V> Sync for LrMap<K, V>
impl<K, V> Unpin for LrMap<K, V>
impl<K, V> UnsafeUnpin for LrMap<K, V>where
*const ArcInner<Atomic<*mut HashMap<K, V>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<*mut HashMap<K, V>>>>: UnsafeUnpin,
*const ArcInner<Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const HashMap<K, V> is !null: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<MapOp<K, V>>: UnsafeUnpin,
*const ArcInner<CachePadded<Atomic<usize>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<CachePadded<Atomic<usize>>>>: UnsafeUnpin,
PhantomData<*const HashMap<K, V>>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
impl<K, V> UnwindSafe for LrMap<K, V>where
Arc<Atomic<*mut HashMap<K, V>>>: UnwindSafe,
Arc<Mutex<Slab<Arc<CachePadded<Atomic<usize>>>>>>: UnwindSafe,
Mutex<WriteHandle<HashMap<K, V>, MapOp<K, V>>>: UnwindSafe,
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