Trait AsyncMap

Source
pub trait AsyncMap<'a, K, V>{
    type Error: Error;
    type Iterator: Iterator<Item = Result<(K, V), TypedStoreError>>;
    type Keys: Iterator<Item = Result<K, TypedStoreError>>;
    type Values: Iterator<Item = Result<V, TypedStoreError>>;

    // Required methods
    fn contains_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
    ) -> Pin<Box<dyn Future<Output = Result<Option<V>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_raw_bytes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_empty<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn iter<'async_trait>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Self::Iterator> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn keys<'async_trait>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Self::Keys> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn values<'async_trait>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Self::Values> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn multi_get<'life0, 'async_trait, J>(
        &'life0 self,
        keys: impl 'async_trait + IntoIterator<Item = J> + Send,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<V>>, Self::Error>> + Send + 'async_trait>>
       where J: Borrow<K> + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn try_catch_up_with_primary<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn contains_key<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 K, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns true if the map contains a value for the specified key.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 K, ) -> Pin<Box<dyn Future<Output = Result<Option<V>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the value for the given key from the map, if it exists.

Source

fn get_raw_bytes<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 K, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the raw value (serialized bytes) for the given key from the map, if it exists.

Source

fn is_empty<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns true if the map is empty, otherwise false.

Source

fn iter<'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Self::Iterator> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Returns an iterator visiting each key-value pair in the map.

Source

fn keys<'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Self::Keys> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Returns an iterator over each key in the map.

Source

fn values<'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Self::Values> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Returns an iterator over each value in the map.

Source

fn multi_get<'life0, 'async_trait, J>( &'life0 self, keys: impl 'async_trait + IntoIterator<Item = J> + Send, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<V>>, Self::Error>> + Send + 'async_trait>>
where J: Borrow<K> + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Returns a vector of values corresponding to the keys provided, non-atomically.

Source

fn try_catch_up_with_primary<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Try to catch up with primary when running as secondary

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§