pub trait Query<S>:
Clone
+ PartialEq
+ 'static {
type Output: 'static;
// Required method
fn run(
self,
state: S,
) -> impl Future<Output = Result<Self::Output, RouteError>> + 'static;
// Provided method
fn depends(&self) -> Vec<String> { ... }
}Expand description
Async data that views read with Remote::query, cached by value.
The type is the query and its value the input: SearchAuthors("fe".into()) and
SearchAuthors("fer".into()) are two entries of the same query, and every view reading an
equal value shares one result.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn depends(&self) -> Vec<String>
fn depends(&self) -> Vec<String>
Reruns the query when one of these keys is invalidated,
like Page::depends.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".