Macro input_macro::try_input
source · [−]macro_rules! try_input {
() => { ... };
($($arg:tt)*) => { ... };
}Expand description
Attempts to display the formatted prompt to the standard output
then read the next line (CR or CRLF) from the standard input.
Returns io::Result<String> (see input! for more).
Examples
println!("Hello, {}!", try_input!("What's your name? ").unwrap());