Struct read_input::InputBuilder [−][src]
pub struct InputBuilder<T: FromStr> { /* fields omitted */ }
Expand description
‘builder’ used to store the settings that are used to fetch input.
.get()
method only takes these settings by reference so can be called multiple times.
This type does not have support for default input value.
Implementations
Changes or adds a default input value.
If the user presses enter before typing anything .get()
will return a default value when InputBuilder::default is used.
let input = input().msg("Please input pi: ").default(3.141).get();
Trait Implementations
Changes or adds a prompt message that gets printed once when input if fetched. Read more
Changes or adds a prompt message and that is repeated each time input is requested. Read more
Adds a validation check on input to ensure the value meets your criteria. Read more
Does the same thing as InputBuild::err, but with a custom error message printed when the test fails. Read more
Removes all validation checks made by InputBuild::add_test
, InputBuild::add_err_test
,
InputBuild::inside
and InputBuild::inside_err
. Read more
Ensures that input is within a range, array or vector. Read more
Does the same thing as InputBuild::inside
, but with a custom error message
printed when input fails. Read more
Toggles whether a prompt message gets printed once or each time input is requested.
Send prompts to custom writer instead of stdout
Send prompts to stderr instead of stdout
Sets a minimum input value with custom error message.
Sets a maximum input value with custom error message.
Sets a minimum and maximum input value with custom error message.
Auto Trait Implementations
impl<T> !RefUnwindSafe for InputBuilder<T>
impl<T> !Send for InputBuilder<T>
impl<T> !Sync for InputBuilder<T>
impl<T> Unpin for InputBuilder<T>
impl<T> !UnwindSafe for InputBuilder<T>
Blanket Implementations
Mutably borrows from an owned value. Read more