read

Macro read 

Source
macro_rules! read {
    ($out:ident as $type:ty) => { ... };
}
Expand description

Read a line from stdin and parse it to a certain type.

Took from stackoverflow

§Panics

Panics if the line contains incorrect symbols.

§Examples

use ognlib::read;

// this creates a variable `x` from the line and parses it into i32
read!(x as i32);