pub struct KeyMap {
pub leader: Option<char>,
pub leader_timeout_ms: u64,
pub overlay_error: Option<String>,
/* private fields */
}Expand description
Resolved map: chord -> action (board scope).
Fields§
§leader: Option<char>Optional leader character from the overlay.
leader_timeout_ms: u64How long a leader chord stays armed, in milliseconds.
overlay_error: Option<String>Why the overlay was refused, when defaults were kept instead.
Implementations§
Source§impl KeyMap
impl KeyMap
Sourcepub fn from_defaults() -> Self
pub fn from_defaults() -> Self
Compiled-in chords, no overlay.
Sourcepub fn load() -> Self
pub fn load() -> Self
Load $VISSUE_KEYS or ~/.config/vissue/keys.toml over the defaults.
A missing file keeps the defaults. A broken overlay also keeps the
defaults and records the reason in Self::overlay_error.
Sourcepub fn get(&self, chord: &str) -> Option<ActionId>
pub fn get(&self, chord: &str) -> Option<ActionId>
Action bound to chord in board scope, if any.
Sourcepub fn help_lines(&self) -> Vec<String>
pub fn help_lines(&self) -> Vec<String>
Help overlay rows: resolved chord, then the dotted action id.
Sourcepub fn occupancy(&self) -> Vec<(String, String)>
pub fn occupancy(&self) -> Vec<(String, String)>
Every bound chord and the dotted action id it maps to.
Sourcepub fn table_lines(&self) -> Vec<String>
pub fn table_lines(&self) -> Vec<String>
One line per action: scope, id, resolved chord.
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
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<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