Skip to main content

StoreWrite

Trait StoreWrite 

Source
pub trait StoreWrite: StoreBase {
    // Required methods
    fn insert(&self, key: Self::Key, value: Self::Value);
    fn delete(&self, key: &Self::Key) -> bool;
}

Required Methods§

Source

fn insert(&self, key: Self::Key, value: Self::Value)

Insert a value into the store

§Arguments:
  • key: the key associated with the value
  • value: the value itself
Source

fn delete(&self, key: &Self::Key) -> bool

Remove a value from the store

§Arguments
  • key: the key to be removed
§Returns
  • true if the key existed and has been removed
  • false otherwise

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> StoreWrite for MemoryStore<K, V>