pub fn read_u32_def_err(msg: Option<&str>) -> u32Expand description
§ARGUMENTS
‘msg’ (Option<&str>) - an optional message which will be printed at the same line as the input prompt. Must be set to Some(“…”) or None.
§DESCRIPTION
Prompts the user to type an integer value (u32) which will then be returned. If user writes an invalid value, they will be prompted to try again.
Provides an information message on the same line as the prompt if Some(“…”) is provided, and just the prompt if None is provided.
Useful for prototyping and quick tests.
§RETURNS
An integer value of type u32 provided by the user.
§EXAMPLES
use quick_input::read_u32_def_err;
let user_u32_with_msg = read_u32_def_err(Some("Please input a number: "));
let user_u32: u32 = read_u32_def_err(None);