#[non_exhaustive]pub enum AnswerPromptError {
ClosedInput,
DroppedRequest,
UnscriptedPrompt,
UnusableTerminal {
source: Error,
},
}Expand description
The error that ends a prompt without an answer from the user
The presenter reports this error through the Reply of a request. No variant is an
answer, so a command must not treat one as a yes, a no, or a default.
A later release can add variants. Match with a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ClosedInput
The user closed the input instead of answering
On a terminal, Ctrl+D closes the input.
DroppedRequest
The presenter dropped the request without an answer
A presenter that cannot ask a user drops every request.
UnscriptedPrompt
The script of a test holds no answer that fits the prompt
A ScriptedUser reports this when its script has ended, and when the next answer is
for another kind of prompt.
UnusableTerminal
The terminal could not show the prompt or read the answer
Trait Implementations§
Source§impl Debug for AnswerPromptError
impl Debug for AnswerPromptError
Source§impl Display for AnswerPromptError
impl Display for AnswerPromptError
Source§impl Error for AnswerPromptError
impl Error for AnswerPromptError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for AnswerPromptError
impl !UnwindSafe for AnswerPromptError
impl Freeze for AnswerPromptError
impl Send for AnswerPromptError
impl Sync for AnswerPromptError
impl Unpin for AnswerPromptError
impl UnsafeUnpin for AnswerPromptError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more