pub struct LightMap<K, V, S = DefaultHashBuilder> { /* private fields */ }
Expand description
A concurrent hashmap implementation thats always non-blocking.
Calls to get and insert are not async and since values are clone, they will never block another thread.
Implementations§
Source§impl<K, V> LightMap<K, V>
impl<K, V> LightMap<K, V>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Source§impl<K, V, S: BuildHasher> LightMap<K, V, S>
impl<K, V, S: BuildHasher> LightMap<K, V, S>
pub fn with_hasher(build_hasher: S) -> Self
pub fn with_capacity_and_hasher(capacity: usize, build_hasher: S) -> Self
Source§impl<K, V, S> LightMap<K, V, S>
impl<K, V, S> LightMap<K, V, S>
pub fn insert(&self, key: K, value: V) -> Option<V>
pub fn get(&self, key: &K) -> Option<V>
Sourcepub fn get_mut<'a>(&'a self, key: &'a K) -> GetMut<'a, K, V>
pub fn get_mut<'a>(&'a self, key: &'a K) -> GetMut<'a, K, V>
Note: Holding this refrence can block ALL operations on this shard
Its important to never hold this refrence for long periods of time espically past an await point
pub fn remove(&self, key: &K) -> Option<V>
Auto Trait Implementations§
impl<K, V, S> Freeze for LightMap<K, V, S>where
S: Freeze,
impl<K, V, S = BuildHasherDefault<AHasher>> !RefUnwindSafe for LightMap<K, V, S>
impl<K, V, S> Send for LightMap<K, V, S>
impl<K, V, S> Sync for LightMap<K, V, S>
impl<K, V, S> Unpin for LightMap<K, V, S>where
S: Unpin,
impl<K, V, S> UnwindSafe for LightMap<K, V, S>
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