Function aoclib::input::parse

source ·
pub fn parse<'a, T>(path: &'a Path) -> Result<impl 'a + Iterator<Item = T>>where
    T: 'a + FromStr,
    <T as FromStr>::Err: Display,
Expand description

Parse the file at the specified path into a stream of T.

Each line is treated as a separate record. Leading and trailing spaces are trimmed before being handed to the parser.

If any record cannot be parsed, this prints the parse error on stderr and stops iteration.

See also parse_str for equivalent functionality for strings, useful for test data.