Trait light_cache::refresh::Refresher

source ·
pub trait Refresher<K, V> {
    type Error;

    // Required method
    fn get(&self, key: K) -> impl Future<Output = Result<V, Self::Error>> + Send;
}
Expand description

A Refresher maps a key to a value asynchronously

Required Associated Types§

Required Methods§

source

fn get(&self, key: K) -> impl Future<Output = Result<V, Self::Error>> + Send

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<K, V, F, Fut, E> Refresher<K, V> for F
where F: Fn(K) -> Fut, Fut: Future<Output = Result<V, E>> + Send,

§

type Error = E