rsonpath/result/
empty.rs

1//! Empty [`Recorder`] implementation, mainly for testing purposes.
2use super::*;
3
4/// Recorder that does nothing.
5pub struct EmptyRecorder;
6
7impl<B: Deref<Target = [u8]>> InputRecorder<B> for EmptyRecorder {
8    #[inline]
9    fn record_block_start(&self, _new_block: B) {
10        // Intentionally left empty.
11    }
12}
13
14impl<B: Deref<Target = [u8]>> Recorder<B> for EmptyRecorder {
15    #[inline]
16    fn record_match(&self, _idx: usize, _depth: Depth, _ty: MatchedNodeType) -> Result<(), EngineError> {
17        // Intentionally left empty.
18        Ok(())
19    }
20
21    #[inline]
22    fn record_value_terminator(&self, _idx: usize, _depth: Depth) -> Result<(), EngineError> {
23        // Intentionally left empty.
24        Ok(())
25    }
26}