Module cargo_lambda_interactive::validator
source · [−]Expand description
Type aliases for functions used by prompts to validate user input before returning the values to their callers.
Validators receive the user input to a given prompt and decide whether
they are valid, returning Ok(())
in the process, or invalid, returning
Err(String)
, where the String
content is an error message to be
displayed to the end user.
When creating containers of validators, e.g. when calling with_validators
in a prompt, you might need to type hint the container with one of the types
below.
This module also provides several built-in validators generated through macros,
exported with the builtin_validators
feature.
Macros
Built-in validator that checks whether the answer length is equal to the specified value.
Built-in validator that checks whether the answer length is smaller than or equal to the specified threshold.
Built-in validator that checks whether the answer length is larger than or equal to the specified threshold.
Built-in validator that checks whether the answer is not empty.
Traits
Custom trait to call correct method to retrieve input length.
Type Definitions
Type alias for validators used in MultiSelect
prompts.