Skip to main content

Description

Struct Description 

Source
pub struct Description<'a> {
    pub text: Option<&'a Text>,
    pub keys: KeyDescriptions<'a>,
}
Expand description

The description for KeyEvents that are mapped or bound in a Mode

This description will include an explaining Text as well as an Iterator, which returns one of the following:

  • A sequence of KeyEvents that are mapped to the action
  • A list of Bindings that are bound to the action

The first one happens when you call map or alias, since they let you map a sequence of KeyEvents.

The second one comes from a Modes own Bindings from Mode::bindings. This is a list of patterns for KeyEvents that are bound to actions. This list is immutable, and each item is an alternation of patterns (e.g. 'a'..='z', “any media key”, concrete KeyEvents, etc).

One other thing to note is that

Fields§

§text: Option<&'a Text>

The Text describing what the KeyEvent will do

§keys: KeyDescriptions<'a>

The Mode’s native bindings and all maps and aliases to those bindings

Auto Trait Implementations§

§

impl<'a> Freeze for Description<'a>

§

impl<'a> !RefUnwindSafe for Description<'a>

§

impl<'a> Send for Description<'a>

§

impl<'a> Sync for Description<'a>

§

impl<'a> Unpin for Description<'a>

§

impl<'a> UnsafeUnpin for Description<'a>

§

impl<'a> !UnwindSafe for Description<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.