[−][src]Crate whiteread
Crate for reading whitespace-separated values.
The crate defines a trait FromStream
, which
describes types that can be parsed from whitespace-separated words,
which includes eg. integers, tuples, vectors and various adapters.
The definition of whitespace used in this crate is described in
SplitAsciiWhitespace
.
Examples
Basics
let (s, i): (String, i32) = parse_string(" answer 42 ").unwrap();
Easy reading from stdin.
let x: i32 = parse_line().unwrap();
Efficient reading from stdin (newline-agnostic) with Reader
.
let mut i = Reader::from_stdin_naive(); while let Some(f) = i.parse::<Option<f64>>()? { println!("{}", f); }
Re-exports
pub use self::stream::FromStream; |
pub use self::reader::Reader; |
Modules
adapters | This module defines adapters for |
reader | This module defines the |
stream | This module defines the |
Functions
parse_file | Parses a whole file as a |
parse_line | Parse |
parse_stdin | Parse the whole stdin as a |
parse_string | Parse |