Trait ca_formats::Input[][src]

pub trait Input {
    type Lines: Iterator;
    type Line: AsRef<str>;
    type Bytes: Iterator<Item = u8>;
    fn lines(self) -> Self::Lines;
fn line(item: <Self::Lines as Iterator>::Item) -> Result<Self::Line, Error>;
fn bytes(line: Self::Line) -> Self::Bytes; }
Expand description

Types that can be passed to parsers as input.

The trait is implemented for &str, &[u8], BufReader, and &mut B for every type B that implements BufRead.

When parsing a file, you can take a BufReader<File> as input.

Associated Types

An iterator over lines of the input.

A string or a reference to a string, which represents a line of the input.

An iterator over bytes of a line.

Required methods

Creates an iterator over lines from the input.

Converts a item in the lines iterator to a string.

Creates an iterator over bytes from a line.

Implementations on Foreign Types

Implementors