pub struct KeyBindingManager { /* private fields */ }Expand description
Manages key bindings for different modes
Implementations§
Source§impl KeyBindingManager
impl KeyBindingManager
pub fn new() -> Self
Sourcepub fn get_command_action(&self, key: &KeyEvent) -> Option<&String>
pub fn get_command_action(&self, key: &KeyEvent) -> Option<&String>
Get the action for a key in command mode
Sourcepub fn get_results_action(&self, key: &KeyEvent) -> Option<&String>
pub fn get_results_action(&self, key: &KeyEvent) -> Option<&String>
Get the action for a key in results mode
Sourcepub fn get_search_action(&self, key: &KeyEvent) -> Option<&String>
pub fn get_search_action(&self, key: &KeyEvent) -> Option<&String>
Get the action for a key in search mode
Sourcepub fn set_binding(&mut self, mode: &str, binding: KeyBinding, action: String)
pub fn set_binding(&mut self, mode: &str, binding: KeyBinding, action: String)
Customize a binding
Sourcepub fn remove_binding(&mut self, mode: &str, binding: &KeyBinding)
pub fn remove_binding(&mut self, mode: &str, binding: &KeyBinding)
Remove a binding
Sourcepub fn get_bindings(&self, mode: &str) -> Vec<(KeyBinding, String)>
pub fn get_bindings(&self, mode: &str) -> Vec<(KeyBinding, String)>
Get all bindings for a mode (for help display)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyBindingManager
impl RefUnwindSafe for KeyBindingManager
impl Send for KeyBindingManager
impl Sync for KeyBindingManager
impl Unpin for KeyBindingManager
impl UnwindSafe for KeyBindingManager
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> 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