Skip to main content

Keymap

Struct Keymap 

Source
pub struct Keymap<V> { /* private fields */ }

Implementations§

Source§

impl<V> Keymap<V>

Source

pub fn new() -> Self

Source

pub fn insert( &mut self, keys: &str, value: V, description: Option<&'static str>, ) -> Option<V>

Source

pub fn remove(&mut self, keys: &str) -> Option<V>

Source

pub fn set_fallback( &mut self, fallback: for<'a> fn(&'a Self, &[Key]) -> KeymapResult<'a, V>, description: Option<&'static str>, )

Source

pub fn get(&self, keys: &str) -> KeymapResult<'_, V>

Source

pub fn get_keys(&self, keys: &[Key]) -> KeymapResult<'_, V>

Source

pub fn iter(&self) -> impl Iterator<Item = (ArrayVec<Key, 3>, &V)> + '_

Source

pub fn docs( &self, ) -> impl Iterator<Item = (Keys<ArrayVec<Key, 3>>, Option<&'static str>)> + '_

Source

pub fn fallback_description(&self) -> Option<&'static str>

Trait Implementations§

Source§

impl<V> Default for Keymap<V>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, V> IntoIterator for &'a Keymap<V>

Source§

type Item = (ArrayVec<Key, 3>, &'a V)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<(ArrayVec<Key, 3>, &'a V)>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<V> Freeze for Keymap<V>
where Trie<Key, Entry<V>>: Freeze, for<'a> fn(&'a Keymap<V>, &[Key]) -> KeymapResult<'a, V>: Freeze,

§

impl<V> RefUnwindSafe for Keymap<V>
where Trie<Key, Entry<V>>: RefUnwindSafe, for<'a> fn(&'a Keymap<V>, &[Key]) -> KeymapResult<'a, V>: RefUnwindSafe,

§

impl<V> Send for Keymap<V>
where Trie<Key, Entry<V>>: Send, for<'a> fn(&'a Keymap<V>, &[Key]) -> KeymapResult<'a, V>: Send,

§

impl<V> Sync for Keymap<V>
where Trie<Key, Entry<V>>: Sync, for<'a> fn(&'a Keymap<V>, &[Key]) -> KeymapResult<'a, V>: Sync,

§

impl<V> Unpin for Keymap<V>
where Trie<Key, Entry<V>>: Unpin, for<'a> fn(&'a Keymap<V>, &[Key]) -> KeymapResult<'a, V>: Unpin,

§

impl<V> UnsafeUnpin for Keymap<V>
where Trie<Key, Entry<V>>: UnsafeUnpin, for<'a> fn(&'a Keymap<V>, &[Key]) -> KeymapResult<'a, V>: UnsafeUnpin,

§

impl<V> UnwindSafe for Keymap<V>
where Trie<Key, Entry<V>>: UnwindSafe, for<'a> fn(&'a Keymap<V>, &[Key]) -> KeymapResult<'a, V>: UnwindSafe,

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<I> FromItem<I> for I

Source§

fn from_item(item: I) -> I

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = !

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more