Trait Compiler

Source
pub trait Compiler {
    type E: Engine;

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

An engine that can be created by compiling a JsonPathQuery.

Required Associated Types§

Source

type E: Engine

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

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§