Enum promptuity::PromptState
source · pub enum PromptState {
Active,
Submit,
Cancel,
Error(String),
Fatal(String),
}
Expand description
A struct representing the state of the prompt.
Controls the rendering of the prompt and the flow of actions like submission.
Variants§
Active
An active state that accepts user inputs like key presses.
Submit
A state where the value is finalized.
Cancel
A state where the prompt is cancelled. e.g. Esc
or Ctrl-C
.
Error(String)
A state for recoverable errors. e.g. validation errors.
Fatal(String)
A state for unrecoverable errors.
Trait Implementations§
source§impl Clone for PromptState
impl Clone for PromptState
source§fn clone(&self) -> PromptState
fn clone(&self) -> PromptState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PromptState
impl Debug for PromptState
source§impl Display for PromptState
impl Display for PromptState
source§impl PartialEq for PromptState
impl PartialEq for PromptState
source§fn eq(&self, other: &PromptState) -> bool
fn eq(&self, other: &PromptState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for PromptState
Auto Trait Implementations§
impl RefUnwindSafe for PromptState
impl Send for PromptState
impl Sync for PromptState
impl Unpin for PromptState
impl UnwindSafe for PromptState
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