pub struct SharedMemoryHashMap<K, V> { /* private fields */ }Expand description
The layout of the shared memory is [lock: u8][bucket_count: usize]used: usizevalue data[value data]…
Implementations§
pub fn new(size: usize) -> Result<Self, Error>
pub fn iter(&self) -> SharedMemoryHashMapIter<'_, K, V> ⓘ
pub fn lock(&self) -> Result<LockGuard<'_>, Box<dyn Error>>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn try_insert(&mut self, key: K, value: V) -> Result<Option<V>, Error>
pub fn get(&mut self, key: &K) -> Option<V>
pub fn peak(&self, key: &K) -> Option<V>
pub fn get_lru(&self) -> Option<(K, V)>
pub fn remove(&mut self, key: &K) -> Option<V>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn used(&self) -> usize
pub fn free(&self) -> usize
pub fn contains_key(&mut self, key: &K) -> bool
pub fn clear(&mut self)
pub fn size_of(key: &K, value: &V) -> usize
pub fn try_clone(&self) -> Result<Self, Error>
Trait Implementations§
Auto Trait Implementations§
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