[][src]Trait ca_formats::Input

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; }

Types that can be passed to parsers as input.

The trait is implemented for &str and BufReader. When parsing a file, you can take a BufReader<File> as input.

Associated Types

type Lines: Iterator

type Line: AsRef<str>

type Bytes: Iterator<Item = u8>

Loading content...

Required methods

fn lines(self) -> Self::Lines

fn line(item: <Self::Lines as Iterator>::Item) -> Result<Self::Line, Error>

fn bytes(line: Self::Line) -> Self::Bytes

Loading content...

Implementations on Foreign Types

impl<'a> Input for &'a str[src]

type Lines = Lines<'a>

type Line = &'a str

type Bytes = Bytes<'a>

impl<R: Read> Input for BufReader<R>[src]

type Lines = IoLines<BufReader<R>>

type Line = String

type Bytes = IntoIter<u8>

Loading content...

Implementors

Loading content...