Skip to main content

Frontend

Trait Frontend 

Source
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§

Source

fn name(&self) -> &str

The dialect name ("lucene").

Source

fn dialect(&self) -> &QueryDialect

The boolean-syntax configuration.

Source

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§

Source

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".

Implementors§