Trait rapidquery::Resolver
source · [−]pub trait Resolver<V> where
V: BitAndAssign + BitOrAssign + Not, {
type Error;
fn resolve_tag(&self, tag: &str) -> Result<V, Self::Error>;
fn resolve_key_value(
&self,
key: &str,
value: &str
) -> Result<V, Self::Error>;
fn resolve_key(&self, key: &str) -> Result<V, Self::Error>;
fn resolve_children(&self, parent_id: &str) -> Result<V, Self::Error>;
fn resolve_empty(&self) -> Result<V, Self::Error>;
}
Expand description
Trait describing a query context resolver.
The resolver is needed by RapidQuery to provide the initial values for computing the query.
For instance, when evaluating the query (a || b) && c
, the evaluator will call Resolver::load_tag()
with a
, b
, and c
. From there, it’ll be in a position to compute the final result of the query.
Associated Types
Required methods
fn resolve_tag(&self, tag: &str) -> Result<V, Self::Error>
fn resolve_tag(&self, tag: &str) -> Result<V, Self::Error>
Resolves the set matching a given tag.
Resolves the set matching a given key/value pair.
fn resolve_key(&self, key: &str) -> Result<V, Self::Error>
fn resolve_key(&self, key: &str) -> Result<V, Self::Error>
Resolves the set matching any key/value pairs with the given key.
fn resolve_children(&self, parent_id: &str) -> Result<V, Self::Error>
fn resolve_children(&self, parent_id: &str) -> Result<V, Self::Error>
Resolves the set matching a given parent ID.
fn resolve_empty(&self) -> Result<V, Self::Error>
fn resolve_empty(&self) -> Result<V, Self::Error>
Resolves the set of all possible items that could match a query.