Skip to main content

Source

Trait Source 

Source
pub trait Source {
    // Required methods
    fn next_line(&mut self) -> Result<Option<Line>>;
    fn label(&self) -> &str;
    fn is_seekable(&self) -> bool;
}
Expand description

A stream of input lines with 1-indexed line numbers.

Implementations own the underlying reader and handle newline stripping.

Required Methods§

Source

fn next_line(&mut self) -> Result<Option<Line>>

Read the next line. Returns Ok(None) at EOF.

Source

fn label(&self) -> &str

A short label for this source, used for the filename prefix (- for stdin).

Source

fn is_seekable(&self) -> bool

Can this source be paired with positional selectors? false for stdin.

Implementors§