pub trait Recorder<B: Deref<Target = [u8]>>: InputRecorder<B> {
// Required methods
fn record_match(
&self,
idx: usize,
depth: Depth,
ty: MatchedNodeType,
) -> Result<(), EngineError>;
fn record_value_terminator(
&self,
idx: usize,
depth: Depth,
) -> Result<(), EngineError>;
}
Expand description
An observer that can determine the query result based on match and structural events coming from the execution engine.
Required Methods§
Sourcefn record_match(
&self,
idx: usize,
depth: Depth,
ty: MatchedNodeType,
) -> Result<(), EngineError>
fn record_match( &self, idx: usize, depth: Depth, ty: MatchedNodeType, ) -> Result<(), EngineError>
Record a match of the query at a given depth
.
The idx
is guaranteed to be the first character of the matched value.
The type MUST accurately describe the value being matched.
§Errors
An error can be raised if an output write occurs and the underlying Sink
implementation
returns an error (EngineError::SinkError
).
Sourcefn record_value_terminator(
&self,
idx: usize,
depth: Depth,
) -> Result<(), EngineError>
fn record_value_terminator( &self, idx: usize, depth: Depth, ) -> Result<(), EngineError>
Record a structural character signifying the end of a value at a given idx
and with given depth
.
§Errors
An error can be raised if an output write occurs and the underlying Sink
implementation
returns an error (EngineError::SinkError
), or if the terminator was not expected
(EngineError::MissingOpeningCharacter
).