from_parser_fn

Function from_parser_fn 

Source
pub fn from_parser_fn<'i, O>(
    f: impl Fn(&'i [u8], &mut ParseState<'i>, &mut bool, bool) -> ParserResult<'i, O>,
) -> impl Parser<'i, Output = O>
Expand description

Parser which delegates to the provided function/closure.

This wrapper exists to avoid conflicting implementations of the Parser trait, which would occur if both Leaf and Parser were implemented for the Fn trait family.