Enum rustyline::Cmd[][src]

#[non_exhaustive]pub enum Cmd {
    Abort,
    AcceptLine,
    BeginningOfHistory,
    CapitalizeWord,
    ClearScreen,
    Complete,
    CompleteBackward,
    CompleteHint,
    Dedent(Movement),
    DowncaseWord,
    EndOfFile,
    EndOfHistory,
    ForwardSearchHistory,
    HistorySearchBackward,
    HistorySearchForward,
    Indent(Movement),
    Insert(RepeatCountString),
    Interrupt,
    Kill(Movement),
    Move(Movement),
    NextHistory,
    Noop,
    Overwrite(char),
    PreviousHistory,
    QuotedInsert,
    ReplaceChar(RepeatCountchar),
    Replace(MovementOption<String>),
    ReverseSearchHistory,
    SelfInsert(RepeatCountchar),
    Suspend,
    TransposeChars,
    TransposeWords(RepeatCount),
    Undo(RepeatCount),
    Unknown,
    UpcaseWord,
    ViYankTo(Movement),
    Yank(RepeatCountAnchor),
    YankPop,
    LineUpOrPreviousHistory(RepeatCount),
    LineDownOrNextHistory(RepeatCount),
    Newline,
    AcceptOrInsertLine {
        accept_in_the_middle: bool,
    },
}

Commands

Variants (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.
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

HistorySearchBackward

history-search-backward

HistorySearchForward

history-search-forward

Indent(Movement)

Indent current line

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

Overwrite(char)

vi-replace

PreviousHistory

previous-history

QuotedInsert

quoted-insert

ReplaceChar(RepeatCountchar)

vi-change-char

Replace(MovementOption<String>)

vi-change-to, vi-substitute

ReverseSearchHistory

reverse-search-history

SelfInsert(RepeatCountchar)

self-insert

Suspend

Suspend signal (Ctrl-Z on unix platform)

TransposeChars

transpose-chars

TransposeWords(RepeatCount)

transpose-words

undo

Unknown

Unsupported / unexpected

UpcaseWord

upcase-word

ViYankTo(Movement)

vi-yank-to

yank, vi-put

YankPop

yank-pop

LineUpOrPreviousHistory(RepeatCount)

moves cursor to the line above or switches to prev history entry if the cursor is already on the first line

LineDownOrNextHistory(RepeatCount)

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.

Fields of AcceptOrInsertLine

accept_in_the_middle: bool

Whether this commands accepts input if the cursor not at the end of the current input

Implementations

impl Cmd[src]

pub fn should_reset_kill_ring(&self) -> bool[src]

Tells if current command should reset kill ring.

Trait Implementations

impl Clone for Cmd[src]

impl Debug for Cmd[src]

impl From<Cmd> for EventHandler[src]

impl PartialEq<Cmd> for Cmd[src]

impl StructuralPartialEq for Cmd[src]

Auto Trait Implementations

impl RefUnwindSafe for Cmd

impl Send for Cmd

impl Sync for Cmd

impl Unpin for Cmd

impl UnwindSafe for Cmd

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsAny for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.