Function svf::parse_iter_bufread[][src]

pub fn parse_iter_bufread<T: BufRead>(
    input: &mut T
) -> impl Iterator<Item = Result<Command, SVFParseError>> + '_

Parse an SVF input from a BufRead into an iterator of commands.

The returned iterator reads from the BufRead one command at a time, returning each valid Command in sequence until it either reaches the end of the input or encounters a parsing error. Because the input is read in chunks, neither the whole input nor all the commands need to be stored in memory at once.

Because the input is parsed incrementally, errors later in the input are only reported when encountered, even if some commands have already been parsed correctly. To parse the entire input in one shot, use parse_complete.

On error, an SVFParseError is returned, which contains the line and column number of the error and an error description, and implements Display for showing errors to users.