Enum Action

Source
#[non_exhaustive]
pub enum Action<I: ApplicationInfo = EmptyInfo> {
Show 17 variants NoOp, Editor(EditorAction), Macro(MacroAction), Jump(PositionList, MoveDir1D, Count), Repeat(RepeatType), Scroll(ScrollStyle), KeywordLookup, RedrawScreen, ShowInfoMessage(InfoMessage), Suspend, Search(MoveDirMod, Count), Command(CommandAction), CommandBar(CommandBarAction<I>), Prompt(PromptAction), Tab(TabAction<I>), Window(WindowAction<I>), Application(I::Action),
}
Expand description

The result of either pressing a complete keybinding sequence, or parsing a command.

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.
§

NoOp

Do nothing.

§

Editor(EditorAction)

Perform an editor action.

§

Macro(MacroAction)

Perform a macro-related action.

§

Jump(PositionList, MoveDir1D, Count)

Navigate through the cursor positions in the specified list.

If the current window cannot satisfy the given Count, then this may jump to other windows.

§

Repeat(RepeatType)

Repeat an action sequence with the current context.

§

Scroll(ScrollStyle)

Scroll the viewport in the specified manner.

§

KeywordLookup

Lookup the keyword under the cursor.

§

RedrawScreen

Redraw the screen.

§

ShowInfoMessage(InfoMessage)

Show an InfoMessage.

§

Suspend

Suspend the process.

§

Search(MoveDirMod, Count)

Find the nth occurrence of the current application-level search.

§

Command(CommandAction)

Perform a command-related action.

§

CommandBar(CommandBarAction<I>)

Perform a command bar-related action.

§

Prompt(PromptAction)

Perform a prompt-related action.

§

Tab(TabAction<I>)

Perform a tab-related action.

§

Window(WindowAction<I>)

Perform a window-related action.

§

Application(I::Action)

Application-specific command.

Implementations§

Source§

impl<I: ApplicationInfo> Action<I>

Source

pub fn is_edit_sequence( &self, motion: SequenceStatus, ctx: &EditContext, ) -> SequenceStatus

Indicates how an action gets included in RepeatType::EditSequence.

motion indicates what to do with EditAction::Motion.

Source

pub fn is_last_action(&self, ctx: &EditContext) -> SequenceStatus

Indicates how an action gets included in RepeatType::LastAction.

Source

pub fn is_last_selection(&self, ctx: &EditContext) -> SequenceStatus

Indicates how an action gets included in RepeatType::LastSelection.

Source

pub fn is_switchable(&self, ctx: &EditContext) -> bool

Returns true if this Action is allowed to trigger a WindowAction::Switch after an error.

Trait Implementations§

Source§

impl<I: Clone + ApplicationInfo> Clone for Action<I>
where I::Action: Clone,

Source§

fn clone(&self) -> Action<I>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I: Debug + ApplicationInfo> Debug for Action<I>
where I::Action: Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<I: ApplicationInfo> Default for Action<I>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<I: ApplicationInfo> From<CommandAction> for Action<I>

Source§

fn from(act: CommandAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<CommandBarAction<I>> for Action<I>

Source§

fn from(act: CommandBarAction<I>) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<CursorAction> for Action<I>

Source§

fn from(act: CursorAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<EditorAction> for Action<I>

Source§

fn from(act: EditorAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<HistoryAction> for Action<I>

Source§

fn from(act: HistoryAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<InsertTextAction> for Action<I>

Source§

fn from(act: InsertTextAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<MacroAction> for Action<I>

Source§

fn from(act: MacroAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<PromptAction> for Action<I>

Source§

fn from(act: PromptAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<SelectionAction> for Action<I>

Source§

fn from(act: SelectionAction) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<TabAction<I>> for Action<I>

Source§

fn from(act: TabAction<I>) -> Self

Converts to this type from the input type.
Source§

impl<I: ApplicationInfo> From<WindowAction<I>> for Action<I>

Source§

fn from(act: WindowAction<I>) -> Self

Converts to this type from the input type.
Source§

impl<I: PartialEq + ApplicationInfo> PartialEq for Action<I>
where I::Action: PartialEq,

Source§

fn eq(&self, other: &Action<I>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I: Eq + ApplicationInfo> Eq for Action<I>
where I::Action: Eq,

Source§

impl<I: ApplicationInfo> StructuralPartialEq for Action<I>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.