#[non_exhaustive]pub enum Key {
}Expand description
A logical key, abstracted away from physical scan codes.
Character carries the produced text for printable keys; named variants
cover the common non-printable keys needed for navigation and editing.
The enum is #[non_exhaustive]: new variants added in future releases will
deserialise as a serde unknown-field error rather than silently mismatching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Character(String)
A printable character (already mapped through the active layout/IME).
Enter
Enter / Return.
Tab
Tab.
Space
Space bar.
Backspace
Backspace.
Delete
Delete (forward delete).
Escape
Escape.
ArrowLeft
Left arrow.
ArrowRight
Right arrow.
ArrowUp
Up arrow.
ArrowDown
Down arrow.
Home
Home.
End
End.
PageUp
Page Up.
PageDown
Page Down.
Function(u8)
A function key F1–F24 (the u8 is the number, 1-based).
Named(String)
Any other named key, identified by string (forward-compatible escape).
Implementations§
Trait Implementations§
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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