pub trait Frontend {
// Required methods
fn name(&self) -> &str;
fn dialect(&self) -> &QueryDialect;
fn parse_atom(
&self,
atom: &str,
ctx: &ReverseCtx,
) -> Result<QueryExpr<QueryLeaf>>;
// Provided method
fn parse_query(&self, query: &str, ctx: &ReverseCtx) -> Result<IrRule> { ... }
}Expand description
A reverse-conversion target: parses one query dialect into the HIR.
The inverse of Backend. Implementors provide a
QueryDialect and a leaf parser; the default Frontend::parse_query
tokenizes, builds the boolean tree, expands each atom via
Frontend::parse_atom, and assembles the IrRule.
Required Methods§
Sourcefn dialect(&self) -> &QueryDialect
fn dialect(&self) -> &QueryDialect
The boolean-syntax configuration.
Sourcefn parse_atom(
&self,
atom: &str,
ctx: &ReverseCtx,
) -> Result<QueryExpr<QueryLeaf>>
fn parse_atom( &self, atom: &str, ctx: &ReverseCtx, ) -> Result<QueryExpr<QueryLeaf>>
Parse a single leaf atom (a field:value, range, value group, or bare
term) into a boolean sub-tree of resolved leaves.
Provided Methods§
Sourcefn parse_query(&self, query: &str, ctx: &ReverseCtx) -> Result<IrRule>
fn parse_query(&self, query: &str, ctx: &ReverseCtx) -> Result<IrRule>
Parse a full query into an IrRule.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".