#[non_exhaustive]pub enum PromptUserError {
#[non_exhaustive] AbsentUser {
question: String,
},
#[non_exhaustive] CancelledPrompt {
question: String,
},
#[non_exhaustive] MissingOptions {
question: String,
},
#[non_exhaustive] UnansweredPrompt {
question: String,
source: AnswerPromptError,
},
#[non_exhaustive] UnknownOption {
question: String,
index: usize,
count: usize,
},
#[non_exhaustive] UndeliverablePrompt {
question: String,
source: SendError,
},
}Expand description
The error returned when a command cannot get an answer from its user
No variant is an answer, so a command must not treat one as a yes, a no, or a default. Every variant carries the text of the question.
A later release can add variants, and it can add fields to a variant. Match with a wildcard
arm, and bind the fields of a variant with ...
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]AbsentUser
No user is present who can answer
The Interactivity of the prompt is NonInteractive. The prompt sends no request.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]CancelledPrompt
Cancellation stopped the prompt before the user answered
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]MissingOptions
The command asked the user to select from no options
The prompt sends no request.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]UnansweredPrompt
The presenter returned no answer
The source is the reason.
Fields
This variant is marked as non-exhaustive
source: AnswerPromptErrorThe cause of the failure
#[non_exhaustive]UnknownOption
The answer names an option that the prompt does not have
The presenter sent a position beyond the options. The cause is a fault in the presenter, or a script of a test that does not match the question.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]UndeliverablePrompt
The prompt could not be sent to the presenter
The event channel is closed.
Fields
This variant is marked as non-exhaustive
Trait Implementations§
Source§impl Debug for PromptUserError
impl Debug for PromptUserError
Source§impl Display for PromptUserError
impl Display for PromptUserError
Source§impl Error for PromptUserError
impl Error for PromptUserError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()