Function result_iterator

Source
pub fn result_iterator<P, I, O, E>(
    input: I,
    parser: P,
) -> impl Iterator<Item = Result<O, Err<E>>>
where P: Fn(I) -> IResult<I, O, E>, I: InputLength, E: ParseError<I>,
Expand description

Create an iterator that repeatedly executes the parser.

Unlike [nom::combinator::iterator], this yields a Result at every step, so errors are returned in the stream, and there is no separate finish() method. If the parser encounters an error, the iterator will yield that error and not attempt to parse any more elements.