#[non_exhaustive]pub enum Key {
Show 14 variants
Enter,
Space,
Backspace,
Escape,
Tab,
Up,
Down,
Left,
Right,
Home,
End,
Char(char),
Interrupt,
Unknown,
}Expand description
A single decoded keystroke from an interactive terminal.
Only the keys the prompt widgets act on are modelled; anything else decodes
to Key::Unknown so callers can ignore it without a catch-all on a
platform enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Enter
Confirm the current answer (Enter / Return).
Space
Space bar — toggles the focused item in multi-select, or inserts a literal space in text entry.
Backspace
Delete the character before the cursor (Backspace).
Escape
Abandon the prompt (Escape).
Tab
Advance focus (Tab).
Up
Move focus up / to the previous item.
Down
Move focus down / to the next item.
Left
Move the text cursor left.
Right
Move the text cursor right.
Home
Jump to the first item / start of line.
End
Jump to the last item / end of line.
Char(char)
A printable character was typed.
Interrupt
A cancellation request (Ctrl+C / Ctrl+D).
Unknown
A key with no prompt-relevant meaning.
Implementations§
Trait Implementations§
impl Copy for Key
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.