Trait QueryCapability

Source
pub trait QueryCapability
where Self: 'static + Clone + PartialEq + Hash + Eq,
{ type Ok; type Err; type Keys: Hash + PartialEq + Clone; // Required method fn run( &self, keys: &Self::Keys, ) -> impl Future<Output = Result<Self::Ok, Self::Err>>; // Provided method fn matches(&self, _keys: &Self::Keys) -> bool { ... } }

Required Associated Types§

Required Methods§

Source

fn run( &self, keys: &Self::Keys, ) -> impl Future<Output = Result<Self::Ok, Self::Err>>

Query logic.

Provided Methods§

Source

fn matches(&self, _keys: &Self::Keys) -> bool

Implement a custom logic to check if this query should be invalidated or not given a QueryCapability::Keys.

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§