#[non_exhaustive]pub enum Cmd {
Show 43 variants
Abort,
AcceptLine,
BeginningOfHistory,
CapitalizeWord,
ClearScreen,
Complete,
CompleteBackward,
CompleteHint,
Dedent(Movement),
DowncaseWord,
EndOfFile,
EndOfHistory,
ForwardSearchHistory,
HistorySearchBackward,
HistorySearchForward,
Indent(Movement),
Insert(usize, String),
Interrupt,
Kill(Movement),
Move(Movement),
NextHistory,
Noop,
Repaint,
Overwrite(char),
PreviousHistory,
QuotedInsert,
ReplaceChar(usize, char),
Replace(Movement, Option<String>),
ReverseSearchHistory,
SelfInsert(usize, char),
Suspend,
TransposeChars,
TransposeWords(usize),
Undo(usize),
Unknown,
UpcaseWord,
ViYankTo(Movement),
Yank(usize, Anchor),
YankPop,
LineUpOrPreviousHistory(usize),
LineDownOrNextHistory(usize),
Newline,
AcceptOrInsertLine {
accept_in_the_middle: bool,
},
}
Expand description
Commands
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Abort
abort
AcceptLine
accept-line
See also AcceptOrInsertLine
BeginningOfHistory
beginning-of-history
CapitalizeWord
capitalize-word
ClearScreen
clear-screen
Complete
complete
CompleteBackward
complete-backward
CompleteHint
complete-hint
Dedent(Movement)
Dedent current line
DowncaseWord
downcase-word
EndOfFile
vi-eof-maybe
EndOfHistory
end-of-history
ForwardSearchHistory
forward-search-history (incremental search)
HistorySearchBackward
history-search-backward (common prefix search)
HistorySearchForward
history-search-forward (common prefix search)
Indent(Movement)
Indent current line
Insert(usize, String)
Insert text
Interrupt
Interrupt signal (Ctrl-C)
Kill(Movement)
backward-delete-char, backward-kill-line, backward-kill-word delete-char, kill-line, kill-word, unix-line-discard, unix-word-rubout, vi-delete, vi-delete-to, vi-rubout
Move(Movement)
backward-char, backward-word, beginning-of-line, end-of-line, forward-char, forward-word, vi-char-search, vi-end-word, vi-next-word, vi-prev-word
NextHistory
next-history
Noop
No action
Repaint
repaint
Overwrite(char)
vi-replace
PreviousHistory
previous-history
QuotedInsert
quoted-insert
ReplaceChar(usize, char)
vi-change-char
Replace(Movement, Option<String>)
vi-change-to, vi-substitute
ReverseSearchHistory
reverse-search-history (incremental search)
SelfInsert(usize, char)
self-insert
Suspend
Suspend signal (Ctrl-Z on unix platform)
TransposeChars
transpose-chars
TransposeWords(usize)
transpose-words
Undo(usize)
undo
Unknown
Unsupported / unexpected
UpcaseWord
upcase-word
ViYankTo(Movement)
vi-yank-to
Yank(usize, Anchor)
yank, vi-put
YankPop
yank-pop
LineUpOrPreviousHistory(usize)
moves cursor to the line above or switches to prev history entry if the cursor is already on the first line
LineDownOrNextHistory(usize)
moves cursor to the line below or switches to next history entry if the cursor is already on the last line
Newline
Inserts a newline
AcceptOrInsertLine
Either accepts or inserts a newline
Always inserts newline if input is non-valid. Can also insert newline if cursor is in the middle of the text
If you support multi-line input:
- Use
accept_in_the_middle: true
for mostly single-line cases, for example command-line. - Use
accept_in_the_middle: false
for mostly multi-line cases, for example SQL or JSON input.
Implementations§
Trait Implementations§
Source§impl From<Cmd> for EventHandler
impl From<Cmd> for EventHandler
Source§fn from(c: Cmd) -> EventHandler
fn from(c: Cmd) -> EventHandler
impl Eq for Cmd
impl StructuralPartialEq for Cmd
Auto Trait Implementations§
impl Freeze for Cmd
impl RefUnwindSafe for Cmd
impl Send for Cmd
impl Sync for Cmd
impl Unpin for Cmd
impl UnwindSafe for Cmd
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more