pub struct Keymap { /* private fields */ }Implementations§
Source§impl Keymap
impl Keymap
pub fn new() -> Self
Sourcepub fn leader(&self) -> Option<char>
pub fn leader(&self) -> Option<char>
Configured leader char. None means <leader> references
fail to bind.
pub fn set_leader(&mut self, leader: char)
Sourcepub fn bind(
&mut self,
mode: PageMode,
keys: &str,
action: PageAction,
) -> Result<(), BindError>
pub fn bind( &mut self, mode: PageMode, keys: &str, action: PageAction, ) -> Result<(), BindError>
Bind a chord sequence to an action in the given mode. Parses
keys via parse_keys and resolves <leader> to the
configured leader.
Sourcepub fn bind_chords(
&mut self,
mode: PageMode,
chords: &[KeyChord],
action: PageAction,
)
pub fn bind_chords( &mut self, mode: PageMode, chords: &[KeyChord], action: PageAction, )
Bind already-parsed chords. Used by the engine when feeding programmatic bindings.
Sourcepub fn lookup(&self, mode: PageMode, chords: &[KeyChord]) -> Lookup<'_>
pub fn lookup(&self, mode: PageMode, chords: &[KeyChord]) -> Lookup<'_>
Look up the chord sequence under mode.
Sourcepub fn resolve_timeout(
&self,
mode: PageMode,
chords: &[KeyChord],
) -> Option<&PageAction>
pub fn resolve_timeout( &self, mode: PageMode, chords: &[KeyChord], ) -> Option<&PageAction>
Resolve the longest-prefix action along chords — the engine
uses this when the ambiguity timeout fires.
Sourcepub fn entries(&self, mode: PageMode) -> Vec<(Vec<KeyChord>, PageAction)>
pub fn entries(&self, mode: PageMode) -> Vec<(Vec<KeyChord>, PageAction)>
Flatten every binding under mode to (chord_sequence, action)
pairs. Order is unspecified — callers that want deterministic
output should sort the result. Used by the new-tab page renderer
to list the live keymap, including any hot-reloaded user
overrides.
Sourcepub fn audit_default_bindings(
_leader: char,
) -> Vec<(&'static str, &'static str, PageAction)>
pub fn audit_default_bindings( _leader: char, ) -> Vec<(&'static str, &'static str, PageAction)>
Phase 6 a11y audit: enumerate every static default binding as
(mode_label, keys, action) rows. Sorted by (mode, keys) so
the output is stable; used by --audit-keymap to verify
keyboard-only reachability of every PageAction.
leader mirrors Self::default_bindings; the resolved
<leader> chord is rendered as the literal character so users
can see what they’d type.
Sourcepub fn missing_default_bindings() -> Vec<&'static str>
pub fn missing_default_bindings() -> Vec<&'static str>
Phase 6 a11y guarantee: every PageAction reachable by a
reasonable user is bound to at least one default chord in some
mode. Returns the list of unbound action names (debug-format
of the unit/parameterised variant) — empty Vec means full
coverage.
“Reasonable” here excludes a small allow-list:
PageAction::TabReorder— currently mouse-only by designPageAction::ClearCompletedDownloads— no obvious chord; reachable via:downloadscmdlinePageAction::EnterMode— variant-of-everything; the specificEnterHintMode/OpenOmnibar/etc. cover the surface- [
PageAction::ScrollUp/ScrollDown≠ 1] — only the count=1 variants need a default; counts come from the count buffer
Sourcepub fn default_bindings(leader: char) -> Self
pub fn default_bindings(leader: char) -> Self
Default vim-flavoured bindings. leader is the configured
leader char (vim default is \). See docs/keymap.md for
the full table.
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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