Function input

Source
pub fn input<T>(before: &str) -> T
where T: FromStr, T::Err: Debug,
Expand description

Reads user input from the console.

This function prompts the user with a message (before) and reads a line of input from the console. The input can be empty.

§Arguments

  • before - The text to display before prompting for input. Add here \n for a new line.

§Returns

Returns an T containing the user’s input converted to the specified type.