pub struct SimpleConcurrentHashMap<K, V>(/* private fields */);
Expand description
inefficient but simple concurrent hashmap this should be only used in a test it locks for every write
Implementations§
source§impl<K, V> SimpleConcurrentHashMap<K, V>
impl<K, V> SimpleConcurrentHashMap<K, V>
pub fn new() -> SimpleConcurrentHashMap<K, V>
pub async fn insert(&self, key: K, value: V) -> Option<V>
pub async fn read<'a>(&self) -> RwLockReadGuard<'_, HashMap<K, V>>
pub async fn write<'a>(&self) -> RwLockWriteGuard<'_, HashMap<K, V>>
pub async fn contains_key(&self, key: &K) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<K, V> !Freeze for SimpleConcurrentHashMap<K, V>
impl<K, V> !RefUnwindSafe for SimpleConcurrentHashMap<K, V>
impl<K, V> Send for SimpleConcurrentHashMap<K, V>
impl<K, V> Sync for SimpleConcurrentHashMap<K, V>
impl<K, V> Unpin for SimpleConcurrentHashMap<K, V>
impl<K, V> UnwindSafe for SimpleConcurrentHashMap<K, V>where
K: UnwindSafe,
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