Enum rustyline::Cmd [−][src]
#[non_exhaustive]
pub enum Cmd {
Show 42 variants
Abort,
AcceptLine,
BeginningOfHistory,
CapitalizeWord,
ClearScreen,
Complete,
CompleteBackward,
CompleteHint,
Dedent(Movement),
DowncaseWord,
EndOfFile,
EndOfHistory,
ForwardSearchHistory,
HistorySearchBackward,
HistorySearchForward,
Indent(Movement),
Insert(RepeatCount, String),
Interrupt,
Kill(Movement),
Move(Movement),
NextHistory,
Noop,
Overwrite(char),
PreviousHistory,
QuotedInsert,
ReplaceChar(RepeatCount, char),
Replace(Movement, Option<String>),
ReverseSearchHistory,
SelfInsert(RepeatCount, char),
Suspend,
TransposeChars,
TransposeWords(RepeatCount),
Undo(RepeatCount),
Unknown,
UpcaseWord,
ViYankTo(Movement),
Yank(RepeatCount, Anchor),
YankPop,
LineUpOrPreviousHistory(RepeatCount),
LineDownOrNextHistory(RepeatCount),
Newline,
AcceptOrInsertLine {
accept_in_the_middle: bool,
},
}Expand description
Commands
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
abort
accept-line
See also AcceptOrInsertLine
beginning-of-history
capitalize-word
clear-screen
complete
complete-backward
complete-hint
Dedent current line
Tuple Fields of Dedent
0: Movementdowncase-word
vi-eof-maybe
end-of-history
forward-search-history
history-search-backward
history-search-forward
Indent current line
Tuple Fields of Indent
0: MovementInsert text
Tuple Fields of Insert
0: RepeatCount1: StringInterrupt signal (Ctrl-C)
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
Tuple Fields of Kill
0: Movementbackward-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
Tuple Fields of Move
0: Movementnext-history
No action
vi-replace
Tuple Fields of Overwrite
0: charprevious-history
quoted-insert
vi-change-char
Tuple Fields of ReplaceChar
0: RepeatCount1: charvi-change-to, vi-substitute
reverse-search-history
self-insert
Tuple Fields of SelfInsert
0: RepeatCount1: charSuspend signal (Ctrl-Z on unix platform)
transpose-chars
transpose-words
Tuple Fields of TransposeWords
0: RepeatCountundo
Tuple Fields of Undo
0: RepeatCountUnsupported / unexpected
upcase-word
vi-yank-to
Tuple Fields of ViYankTo
0: Movementyank, vi-put
Tuple Fields of Yank
0: RepeatCount1: Anchoryank-pop
moves cursor to the line above or switches to prev history entry if the cursor is already on the first line
Tuple Fields of LineUpOrPreviousHistory
0: RepeatCountmoves cursor to the line below or switches to next history entry if the cursor is already on the last line
Tuple Fields of LineDownOrNextHistory
0: RepeatCountInserts a newline
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: truefor mostly single-line cases, for example command-line. - Use
accept_in_the_middle: falsefor mostly multi-line cases, for example SQL or JSON input.
Fields of AcceptOrInsertLine
accept_in_the_middle: boolWhether this commands accepts input if the cursor not at the end of the current input
Implementations
Tells if current command should reset kill ring.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Cmd
impl UnwindSafe for Cmd
Blanket Implementations
Mutably borrows from an owned value. Read more