pub struct CompiledKeyboardShortcuts<S> { /* private fields */ }Expand description
CompiledKeyboardShortcuts (@experimental @internal): a shortcut
table indexed by the event’s modifier bits and key (and, for
non-Latin layouts, its code), so a look-up costs the same however
many shortcuts it holds.
Implementations§
Source§impl<S: KeyboardShortcutMatch> CompiledKeyboardShortcuts<S>
impl<S: KeyboardShortcutMatch> CompiledKeyboardShortcuts<S>
pub fn new() -> Self
Sourcepub fn add(&mut self, shortcut: S) -> Result<&mut Self, LexicalError>
pub fn add(&mut self, shortcut: S) -> Result<&mut Self, LexicalError>
add(shortcut).
Sourcepub fn matches(&self, event: &impl KeyboardEventModifiers) -> Vec<Rc<S>>
pub fn matches(&self, event: &impl KeyboardEventModifiers) -> Vec<Rc<S>>
matches(event): every shortcut matching the event, in insertion
order, the matches by key before those by the code fallback.
Sourcepub fn match(&self, event: &impl KeyboardEventModifiers) -> Option<Rc<S>>
pub fn match(&self, event: &impl KeyboardEventModifiers) -> Option<Rc<S>>
match(event): the first shortcut matching the event.
Trait Implementations§
Auto Trait Implementations§
impl<S> !Send for CompiledKeyboardShortcuts<S>
impl<S> !Sync for CompiledKeyboardShortcuts<S>
impl<S> Forget for CompiledKeyboardShortcuts<S>
impl<S> Freeze for CompiledKeyboardShortcuts<S>
impl<S> Move for CompiledKeyboardShortcuts<S>
impl<S> RefUnwindSafe for CompiledKeyboardShortcuts<S>
impl<S> Unpin for CompiledKeyboardShortcuts<S>
impl<S> UnsafeUnpin for CompiledKeyboardShortcuts<S>
impl<S> UnwindSafe for CompiledKeyboardShortcuts<S>
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