Enum rustyline::Cmd[][src]

#[non_exhaustive]
pub enum Cmd {
Show variants 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, },
}
Expand description

Commands

Variants (Non-exhaustive)

This enum is marked as 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.
Show fields

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]

fn clone(&self) -> Cmd[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Cmd[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<Cmd> for EventHandler[src]

fn from(c: Cmd) -> EventHandler[src]

Performs the conversion.

impl PartialEq<Cmd> for Cmd[src]

fn eq(&self, other: &Cmd) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Cmd) -> bool[src]

This method tests for !=.

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn as_any(&self) -> &(dyn Any + 'static)[src]

pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.