pub struct Keymap { /* private fields */ }Implementations§
Source§impl Keymap
impl Keymap
Sourcepub fn from_entries<'a>(
entries: impl IntoIterator<Item = (&'a str, &'a str, Option<&'a str>)>,
) -> Keymap
pub fn from_entries<'a>( entries: impl IntoIterator<Item = (&'a str, &'a str, Option<&'a str>)>, ) -> Keymap
Builds a keymap from (keys, command, when) entries. Later entries win over earlier
ones for the same keys, so user entries go last. A command starting with - removes
that command’s earlier binding for the keys, as in VS Code.
pub fn bindings(&self) -> &[Binding]
Sourcepub fn extend<'a>(
&mut self,
entries: impl IntoIterator<Item = (&'a str, &'a str, Option<&'a str>)>,
)
pub fn extend<'a>( &mut self, entries: impl IntoIterator<Item = (&'a str, &'a str, Option<&'a str>)>, )
Appends entries (user overrides) on top of the current bindings.
Sourcepub fn resolve(
&mut self,
pressed: &KeyPress,
context: &HashMap<String, bool>,
) -> Resolved
pub fn resolve( &mut self, pressed: &KeyPress, context: &HashMap<String, bool>, ) -> Resolved
Resolves a key press against the bindings whose when holds in context. The last
matching binding wins.
pub fn has_pending_chord(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Forget for Keymap
impl Freeze for Keymap
impl Move for Keymap
impl RefUnwindSafe for Keymap
impl Send for Keymap
impl Sync for Keymap
impl Unpin for Keymap
impl UnsafeUnpin for Keymap
impl UnwindSafe for Keymap
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