Function scan::from_path [] [src]

pub fn from_path<P: AsRef<Path>>(
    path: P
) -> Result<Scanner<Chars<BufReader<File>>, fn(_: &char) -> bool>>

Creates a scanner of the file located at path. Returns a result that is either a scanner or an IOError.

Examples

use scan::Scan;
let result = scan::from_path("path/to/file.ext");
match result {
    Ok(mut scanner) => {
        let int = scanner.next::<i32>().unwrap();
        let int2: i32 = scanner.next().unwrap();
    }
    Err(_) => println!(":["),
}