[][src]Trait shared_expiry_get::Provider

pub trait Provider<T: Expiry + Clone + 'static> {
    fn update(&self) -> ExpiryFut<T>;
}

Provides updates to get remote data.

Required methods

fn update(&self) -> ExpiryFut<T>[src]

Provide a updated version of the remote data. E.g via an async http get.

Example:



#[derive(Clone)]
struct MyProvider {}

impl Provider<Payload> for MyProvider {
    fn update(&self) -> Pin<Box<dyn Future<Output = Result<Payload, ExpiryGetError>> + Send>> {
        future::ok::<Payload, ExpiryGetError>(Payload {}).into_future().boxed()
    }
}
Loading content...

Implementors

Loading content...