pub struct InputBuilder<T: FromStr> { /* private fields */ }
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

Creates a new instance of InputBuilder with default settings.

‘gets’ the input form the user.

Changes or adds a default input value.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more
Changes or adds a prompt message that gets printed once when input if fetched.
Changes or adds a prompt message and that is repeated each time input is requested.
Changes fallback error message.
Adds a validation check on input.
Adds a validation check on input with a custom error message printed when the test fails. Read more
Removes all validation checks made by .add_test(), .add_err_test(), .inside() and .inside_err(). Read more
Used specify custom error messages that depend on the errors produced by from_str().
Ensures that input is within a range, array or vector.
Ensures that input is within a range, array or vector 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.
Sets a minimum input value.
Sets a minimum input value with custom error message.
Sets a maximum input value.
Sets a maximum input value with custom error message.
Sets a minimum and maximum input value.
Sets a minimum and maximum input value with custom error message.
Sets a restricted input value.
Sets a restricted input value with custom error message.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.