Struct rings_core::storage::MemStorage
source · Implementations§
source§impl<K, V> MemStorage<K, V>where
K: Copy + Eq + Hash,
V: Clone,
impl<K, V> MemStorage<K, V>where
K: Copy + Eq + Hash,
V: Clone,
pub fn new() -> Self
pub fn get(&self, addr: &K) -> Option<V>
pub fn set(&self, addr: &K, value: V) -> Option<V>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_or_set(&self, addr: &K, default: V) -> V
pub fn keys(&self) -> Vec<K>
pub fn values(&self) -> Vec<V>
pub fn items(&self) -> Vec<(K, V)>
pub fn remove(&self, addr: &K) -> Option<(K, V)>
Trait Implementations§
source§impl<K, V> Clone for MemStorage<K, V>where
K: Copy + Eq + Hash + Clone,
V: Clone + Clone,
impl<K, V> Clone for MemStorage<K, V>where
K: Copy + Eq + Hash + Clone,
V: Clone + Clone,
source§fn clone(&self) -> MemStorage<K, V>
fn clone(&self) -> MemStorage<K, V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more