Refresher

Trait 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

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, V, F, Fut, E> Refresher<K, V> for F
where F: Fn(K) -> Fut, Fut: Future<Output = Result<V, E>> + Send,

Source§

type Error = E