Skip to main content

StoreRead

Trait StoreRead 

Source
pub trait StoreRead<K, V> {
    // Required methods
    fn get(&self, key: &K) -> Option<V>;
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}

Required Methods§

Source

fn get(&self, key: &K) -> Option<V>

Returns the value associated with key from the Store

§Arguments:
  • key: the key indexing the object
§Returns:
  • Some(value), if the value exists
  • None otherwise
Source

fn len(&self) -> usize

Returns the number of elements in the Store

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true, if the store is empty

Implementors§

Source§

impl<K: Ord, V: Clone> StoreRead<K, V> for MemoryStore<K, V>