pub struct KeyBindings { /* private fields */ }Expand description
A mapping from key combinations to actions.
Several key combinations can go to the same action.
Implementations§
Source§impl KeyBindings
impl KeyBindings
pub fn set<A: Into<Action>>(&mut self, ck: KeyCombination, action: A)
pub fn add_vim_keys(&mut self)
pub fn add_all(&mut self, other: &KeyBindings)
pub fn get(&self, key: KeyCombination) -> Option<&Action>
Sourcepub fn shortest_key_for(&self, action: &Action) -> Option<KeyCombination>
pub fn shortest_key_for(&self, action: &Action) -> Option<KeyCombination>
return the shortest key.to_string for the action, if any
Sourcepub fn shortest_key<F>(&self, filter: F) -> Option<KeyCombination>
pub fn shortest_key<F>(&self, filter: F) -> Option<KeyCombination>
return the key combination for the action matching the filter, choosing the one with the shortest Display representation.
Sourcepub fn build_reverse_map(&self) -> HashMap<&Action, Vec<KeyCombination>>
pub fn build_reverse_map(&self) -> HashMap<&Action, Vec<KeyCombination>>
build and return a map from actions to all the possible shortcuts
pub fn iter(&self) -> Iter<'_, KeyCombination, Action>
Trait Implementations§
Source§impl Clone for KeyBindings
impl Clone for KeyBindings
Source§fn clone(&self) -> KeyBindings
fn clone(&self) -> KeyBindings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyBindings
impl Debug for KeyBindings
Source§impl Default for KeyBindings
impl Default for KeyBindings
Source§impl<'de> Deserialize<'de> for KeyBindings
impl<'de> Deserialize<'de> for KeyBindings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> IntoIterator for &'a KeyBindings
impl<'a> IntoIterator for &'a KeyBindings
Source§impl JsonSchema for KeyBindings
impl JsonSchema for KeyBindings
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(_gen: &mut SchemaGenerator) -> Schema
fn json_schema(_gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for KeyBindings
impl RefUnwindSafe for KeyBindings
impl Send for KeyBindings
impl Sync for KeyBindings
impl Unpin for KeyBindings
impl UnwindSafe for KeyBindings
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