pub struct Context<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> { /* private fields */ }
Expand description
Chord definitions.
Implementations§
Source§impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
Sourcepub const fn from_config(config: Config<MAX_CHORDS, MAX_CHORD_SIZE>) -> Self
pub const fn from_config(config: Config<MAX_CHORDS, MAX_CHORD_SIZE>) -> Self
Constructs a context from the given config
Sourcepub fn update_keymap_context(&mut self, _: &KeymapContext)
pub fn update_keymap_context(&mut self, _: &KeymapContext)
Updates the context with the given keymap context.
Sourcepub fn chords_for_keymap_index(
&self,
keymap_index: u16,
) -> Vec<ChordState<MAX_CHORD_SIZE>, MAX_CHORDS>
pub fn chords_for_keymap_index( &self, keymap_index: u16, ) -> Vec<ChordState<MAX_CHORD_SIZE>, MAX_CHORDS>
Returns the chords for the given keymap index.
- If a chord with that index is resolved as active, return a vec with only that chord.
- Otherwise, return a vec with all the chords which include the keymap index and could be satisfied. (i.e. chords which do not overlap with resolved active chords).
Trait Implementations§
Source§impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Clone for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Clone for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
Source§impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Context for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Context for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
Source§impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Debug for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Debug for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
Source§impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> PartialEq for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> PartialEq for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Copy for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> StructuralPartialEq for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
Auto Trait Implementations§
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Freeze for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> RefUnwindSafe for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Send for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Sync for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Unpin for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> UnwindSafe for Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>
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