Skip to main content

KeyMap

Trait KeyMap 

Source
pub trait KeyMap {
    // Required methods
    fn short_help(&self) -> Vec<Binding>;
    fn full_help(&self) -> Vec<Vec<Binding>>;
}
Expand description

KeyMap is a map of keybindings used to generate help. Since it’s an interface it can be any type, though a struct or a map of bindings are likely candidates.

Note that if a key is disabled (via key.Binding::set_enabled) it will not be rendered in the help view, so in theory generated help should self-manage.

Required Methods§

Source

fn short_help(&self) -> Vec<Binding>

ShortHelp returns a slice of bindings to be displayed in the short version of the help. The help bubble will render help in the order in which the help items are returned here.

Source

fn full_help(&self) -> Vec<Vec<Binding>>

FullHelp returns an extended group of help items, grouped by columns. The help bubble will render the help in the order in which the help items are returned here.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§