Loader

Trait Loader 

Source
pub trait Loader<K, V>:
    Send
    + Sync
    + 'static {
    // Required method
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
    ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for automatic data loading on cache miss

Required Methods§

Source

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

Load data for the given key

Implementors§