pub trait Compiler {
    type E<'q>: Engine + 'q;

    // Required methods
    fn compile_query(
        query: &JsonPathQuery
    ) -> Result<Self::E<'_>, CompilerError>;
    fn from_compiled_query(automaton: Automaton<'_>) -> Self::E<'_>;
}
Expand description

Trait for an engine that can be created by compiling a JsonPathQuery.

Required Associated Types§

source

type E<'q>: Engine + 'q

Concrete type of the Engines created, parameterized with the lifetime of the input query.

Required Methods§

source

fn compile_query(query: &JsonPathQuery) -> Result<Self::E<'_>, CompilerError>

Compile a JsonPathQuery into an Engine.

Errors

An appropriate CompilerError is returned if the compiler cannot handle the query.

source

fn from_compiled_query(automaton: Automaton<'_>) -> Self::E<'_>

Turn a compiled Automaton into an Engine.

Implementors§

source§

impl Compiler for MainEngine<'_>

§

type E<'q> = MainEngine<'q>

source§

impl Compiler for RecursiveEngine<'_>

§

type E<'q> = RecursiveEngine<'q>