pub struct Keymap<V> { /* private fields */ }Implementations§
Source§impl<V> Keymap<V>
impl<V> Keymap<V>
pub fn new() -> Self
pub fn insert( &mut self, keys: &str, value: V, description: Option<&'static str>, ) -> Option<V>
pub fn remove(&mut self, keys: &str) -> Option<V>
pub fn set_fallback( &mut self, fallback: for<'a> fn(&'a Self, &[Key]) -> KeymapResult<'a, V>, description: Option<&'static str>, )
pub fn get(&self, keys: &str) -> KeymapResult<'_, V>
pub fn get_keys(&self, keys: &[Key]) -> KeymapResult<'_, V>
pub fn iter(&self) -> impl Iterator<Item = (ArrayVec<Key, 3>, &V)> + '_
pub fn docs( &self, ) -> impl Iterator<Item = (Keys<ArrayVec<Key, 3>>, Option<&'static str>)> + '_
pub fn fallback_description(&self) -> Option<&'static str>
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for Keymap<V>
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>
impl<V> Sync for Keymap<V>
impl<V> Unpin for Keymap<V>
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> 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