Recorder

Trait Recorder 

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

Source

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

Source

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

Implementors§

Source§

impl<B, S> Recorder<B> for NodesRecorder<'_, B, S>
where B: Deref<Target = [u8]>, S: Sink<Match>,

Source§

impl<B: Deref<Target = [u8]>> Recorder<B> for CountRecorder

Source§

impl<B: Deref<Target = [u8]>> Recorder<B> for EmptyRecorder

Source§

impl<B: Deref<Target = [u8]>, S> Recorder<B> for ApproxSpanRecorder<'_, S>
where S: Sink<MatchSpan>,

Source§

impl<B: Deref<Target = [u8]>, S> Recorder<B> for IndexRecorder<'_, S>
where S: Sink<MatchIndex>,