# data-input
### Console (or text file) input assistant.
This crate provides a method to help you input data from the console (or text file).</br>
You can enter data of any primitive type (numbers, logical or chars), as well as strings.</br>
Crate provides the `Input` trait and its implementations for `Stdin` and `File` objects.
#### Example:
let console = std::io::stdin();
let name = console.import::<String>().unwrap();
let age = console.import::<u32>().unwrap();
println!("Name: {}, age: {}", name, age)
In the given example the variable `age` will have type u32.
Line feed characters are used as separators for input strings (spaces and tabs are included to string).</br>
For other types (not strings) separators are: spaces, tabs and line feeds.
Trailing spaces are removed for all data types.
#### Example:
Albert Einstein <-- will be entered as one string value (if import::<String>() use)
1879 1955 <-- will be entered as two numerical values (if import::<u32>() use twice)
Similar syntax for entering data from a text file.
#### Example:
let f = File::open("example.txt").unwrap();
let name = f.import::<String>().unwrap();
let born = f.import::<u32>().unwrap();
println!("Name: {}, born: {}", name, born)