Resolver

Trait Resolver 

Source
pub trait Resolver:
    Clone
    + Send
    + 'static {
    type Key: Span;

    // Required methods
    fn fetch(&mut self, key: Self::Key) -> impl Future<Output = ()> + Send;
    fn cancel(&mut self, key: Self::Key) -> impl Future<Output = ()> + Send;
    fn clear(&mut self) -> impl Future<Output = ()> + Send;
    fn retain(
        &mut self,
        predicate: impl Fn(&Self::Key) -> bool + Send + 'static,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

Responsible for fetching data and notifying a Consumer.

Required Associated Types§

Source

type Key: Span

Type used to uniquely identify data.

Required Methods§

Source

fn fetch(&mut self, key: Self::Key) -> impl Future<Output = ()> + Send

Initiate a fetch request.

Source

fn cancel(&mut self, key: Self::Key) -> impl Future<Output = ()> + Send

Cancel a fetch request.

Source

fn clear(&mut self) -> impl Future<Output = ()> + Send

Cancel all fetch requests.

Source

fn retain( &mut self, predicate: impl Fn(&Self::Key) -> bool + Send + 'static, ) -> impl Future<Output = ()> + Send

Retain only the fetch requests that satisfy the predicate.

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: Span> Resolver for Mailbox<K>

Source§

type Key = K