Skip to main content

StoreRead

Trait StoreRead 

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

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

Required Methods§

Source

fn get(&self, key: &Self::Key) -> Option<Self::Value>

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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