pub fn input_vec<V, VA>(
what: impl Display,
prompt: impl ToString,
second_prompt: impl ToString,
validator: Option<VA>,
history: Option<impl History<String>>,
) -> Result<Vec<V>, Error>
Expand description
Prompts the user for a vector of arbitrary size.
§Arguments
what
: Some string description to show to the user that tells them what kind of value they are inputting. Should fill in:Invalid ...
. Only used in the case they fail the first time.prompt
: The prompt to display to the user. You can use%I
to get the current prompt index.second_prompt
: Another prompt to show for entries beyond the first. You can use%I
to get the current prompt index.validator
: A validator that implements thedialoguer::InputValidator
trait, or None if it is not possible. You can use theNoValidator
concrete type when using no validator like soNone::<NoValidator>
history
: An optionalHistory
-capabable struct that can be used to keep track of this prompt’s history.
§Returns
A new Vec
that contains the user’s entered values.
§Errors
This function errors if we failed to interact with the user.