Struct rings_core::storage::MemStorage
source · pub struct MemStorage<K, V>where
K: Copy + Eq + Hash,
V: Clone,{ /* private fields */ }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 moreAuto Trait Implementations§
impl<K, V> !RefUnwindSafe for MemStorage<K, V>
impl<K, V> Send for MemStorage<K, V>where K: Send, V: Send,
impl<K, V> Sync for MemStorage<K, V>where K: Send + Sync, V: Send + Sync,
impl<K, V> Unpin for MemStorage<K, V>
impl<K, V> UnwindSafe for MemStorage<K, V>where K: UnwindSafe, V: UnwindSafe,
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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