pub enum ListAction {
Up,
Down,
Select,
ToggleDiff,
Cancel,
Toggle,
ToggleAll,
SearchStart,
SearchInput(char),
SearchBackspace,
SearchCancel,
None,
}Expand description
Actions that can be taken in a list selection UI
Variants§
Up
Down
Select
ToggleDiff
Cancel
Toggle
ToggleAll
SearchStart
Enter search mode (/ in normal mode)
SearchInput(char)
Append a character to the search query
SearchBackspace
Remove the last character from the search query
SearchCancel
Leave search mode and restore the unfiltered list
None
Implementations§
Source§impl ListAction
impl ListAction
Sourcepub fn from_key(key: KeyEvent, search_active: bool) -> Self
pub fn from_key(key: KeyEvent, search_active: bool) -> Self
Map a key event to an action.
The mapping depends on the mode. While searching, printable characters (including the normal-mode bindings j/k/q/u) extend the query, Escape leaves search mode instead of cancelling, and navigation moves to the arrow keys and Ctrl+J/Ctrl+K.
Trait Implementations§
Source§impl Clone for ListAction
impl Clone for ListAction
impl Copy for ListAction
Source§impl Debug for ListAction
impl Debug for ListAction
impl Eq for ListAction
Source§impl PartialEq for ListAction
impl PartialEq for ListAction
impl StructuralPartialEq for ListAction
Auto Trait Implementations§
impl Freeze for ListAction
impl RefUnwindSafe for ListAction
impl Send for ListAction
impl Sync for ListAction
impl Unpin for ListAction
impl UnsafeUnpin for ListAction
impl UnwindSafe for ListAction
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
Mutably borrows from an owned value. Read more
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
Compare self to
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> ⓘ
Converts
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> ⓘ
Converts
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