Trait ezio::Read

source · []
pub trait Read: IntoIterator + Read {
    fn read_all(&mut self) -> String;
fn read_line(&mut self) -> String; fn read_line_any<T: FromStr>(&mut self) -> T
    where
        Self: Sized
, { ... } }
Expand description

A trait for objects which can read data.

Can be turned into an iterator to read all available lines as strings.

Required methods

Read and return all available data from self.

Panics if there is an error reading.

Read and return a single line of data from self.

Panics if there is an error reading. Note that for finite data sources (e.g., files) this function will panic when the reader is exhausted. To get all lines (if the number of lines is not known in advance), convert the reader into an iterator instead.

Does not return the terminal newline character.

Provided methods

Read, parse, and return a single line of data from self.

Panics if there is an error reading or parsing data.

Implementors