pub fn dbg_dmp<'a, F, O, E: Debug>(
f: F,
context: &'static str
) -> impl FnMut(&'a [u8]) -> IResult<&'a [u8], O, E>where
F: Parser<&'a [u8], O, E>,👎Deprecated since 0.1.0: Replaced with <code>trace</code> and the <code>debug</code> feature flag
Expand description
Prints a message and the input if the parser fails.
The message prints the Backtrack or Incomplete
and the parser’s calling kind.
It also displays the input in hexdump format
WARNING: Deprecated, replaced with trace and the debug feature flag.
use winnow::{IResult, error::dbg_dmp, bytes::tag};
fn f(i: &[u8]) -> IResult<&[u8], &[u8]> {
dbg_dmp(tag("abcd"), "tag")(i)
}
let a = &b"efghijkl"[..];
// Will print the following message:
// Error(Position(0, [101, 102, 103, 104, 105, 106, 107, 108])) at l.5 by ' tag ! ( "abcd" ) '
// 00000000 65 66 67 68 69 6a 6b 6c efghijkl
f(a);