Skip to main content

AsyncStoreRead

Trait AsyncStoreRead 

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

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

Required Methods§

Source

fn get(&self, key: Self::Key) -> impl Future<Output = 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) -> 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".

Implementors§