pub trait Query:
Send
+ Sync
+ 'static {
type Key: QueryKey;
type Value: QueryValue;
// Required methods
fn compute(&self, db: &dyn QueryDatabase, key: &Self::Key) -> Self::Value;
fn name(&self) -> &'static str;
}Expand description
A query definition with its computation function.
Required Associated Types§
Sourcetype Value: QueryValue
type Value: QueryValue
The value type for this query.
Required Methods§
Sourcefn compute(&self, db: &dyn QueryDatabase, key: &Self::Key) -> Self::Value
fn compute(&self, db: &dyn QueryDatabase, key: &Self::Key) -> Self::Value
Compute the query result for the given key.