Crates.io | scan |
lib.rs | scan |
version | 0.1.0 |
source | src |
created_at | 2015-08-05 05:03:05.031236 |
updated_at | 2015-12-11 23:55:55.315022 |
description | Crate for tokenizing and parsing delimitted input |
homepage | http://github.com/alex-ozdemir/scan |
repository | http://github.com/alex-ozdemir/scan |
max_upload_size | |
id | 2758 |
size | 17,060 |
A tokenizing/parsing utility for Rust
Allows for whitespace-delimited tokens in an input stream to be parsed as any type implementing FromStr
.
extern crate scan;
use scan::Scan;
fn main() {
let mut scanner = scan::from_stdin();
let int = scanner.next::<i32>().unwrap();
let int2: i32 = scanner.next().unwrap();
println!("Integer: {}", int);
println!("Integer 2: {}" int2);
}
This crate can be acquired through crates.io.
One thing of note is that this crate requires nightly rust, due to instability in the io
module.
Documentation is hosted here.