Skip to main content

AsyncStoreRead

Trait AsyncStoreRead 

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

    // Provided method
    fn is_empty(&self) -> impl Future<Output = bool> { ... }
}

Required Methods§

Source

fn get(&self, key: K) -> impl Future<Output = 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) -> impl Future<Output = usize>

Returns the number of elements in the Store

Provided Methods§

Source

fn is_empty(&self) -> impl Future<Output = bool>

Returns true, if the store is empty

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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