pub struct ConcurrentMap<K, V> { /* private fields */ }Expand description
A thread-safe key-value map using DashMap.
Provides concurrent read/write access without explicit locking.
§Example
use spider_core::state::ConcurrentMap;
let map = ConcurrentMap::new();
map.insert("key".to_string(), 42);
assert_eq!(map.get(&"key".to_string()), Some(42));Implementations§
Source§impl<K, V> ConcurrentMap<K, V>
impl<K, V> ConcurrentMap<K, V>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a map with the specified capacity.
Sourcepub fn contains_key(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
Returns true if the map contains the key.
Trait Implementations§
Source§impl<K, V> Clone for ConcurrentMap<K, V>
impl<K, V> Clone for ConcurrentMap<K, V>
Source§impl<K, V> Debug for ConcurrentMap<K, V>
impl<K, V> Debug for ConcurrentMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for ConcurrentMap<K, V>
impl<K, V> !RefUnwindSafe for ConcurrentMap<K, V>
impl<K, V> Send for ConcurrentMap<K, V>
impl<K, V> Sync for ConcurrentMap<K, V>
impl<K, V> Unpin for ConcurrentMap<K, V>
impl<K, V> UnsafeUnpin for ConcurrentMap<K, V>
impl<K, V> UnwindSafe for ConcurrentMap<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