pub struct Bindings {
pub title: Option<Text>,
pub list: Vec<(Vec<Binding>, Text, Option<Bindings>)>,
}Expand description
A list of key bindings available in a given Mode
This list is used for two purposes:
- Provide information about which keys are available in any given
Mode. - Tell the user when they typed in a unavailable binding.
- Warn them when they map or alias to a unavailable binding.
You should always create this struct via
Fields§
§title: Option<Text>An optional title for this Bindings
This should be used to more accurately describe an overall “theme” for all keybindings listed.
list: Vec<(Vec<Binding>, Text, Option<Bindings>)>Descriptions for each of the key bindings
The bindings of the first element are na alternation, not a sequence.
Direct implementation is not recommended, use the
bindings! macro instead.
Implementations§
Source§impl Bindings
impl Bindings
Sourcepub fn matches_sequence(&self, seq: &[KeyEvent]) -> bool
pub fn matches_sequence(&self, seq: &[KeyEvent]) -> bool
Wether these MappedBindings accepts the sequence of
KeyEvents
Sourcepub fn sequence_has_followup(&self, seq: &[KeyEvent]) -> bool
pub fn sequence_has_followup(&self, seq: &[KeyEvent]) -> bool
Wether the given sequence of KeyEvents has a followup
in these MappedBindings
Sourcepub fn bindings_for(&self, seq: &[KeyEvent]) -> Option<&Bindings>
pub fn bindings_for(&self, seq: &[KeyEvent]) -> Option<&Bindings>
Which Bindings are available, given the passed sequence
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bindings
impl !RefUnwindSafe for Bindings
impl Send for Bindings
impl Sync for Bindings
impl Unpin for Bindings
impl UnsafeUnpin for Bindings
impl !UnwindSafe for Bindings
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