pub trait Engine {
    // Required method
    fn run<R: QueryResult>(&self, input: &Input) -> Result<R, EngineError>;
}
Expand description

Trait for an engine that can run its query on a given input.

Required Methods§

source

fn run<R: QueryResult>(&self, input: &Input) -> Result<R, EngineError>

Compute the QueryResult on given Input.

Errors

An appropriate EngineError is returned if the JSON input is malformed and the syntax error is detected.

Please note that detecting malformed JSONs is not guaranteed. Some glaring errors like mismatched braces or double quotes are raised, but in general the result of an engine run on an invalid JSON is undefined. It is guaranteed that the computation terminates and does not panic.

Implementors§