pub struct KeyMods(pub u8);Expand description
Modifier bitfield. Copy + Eq + Hash so the whole KeyChord
fits in a CPU register.
The raw u8 is public for adapters; prefer the named constants, which
combine with | (or Self::with).
§Examples
use lattice_protocol::KeyMods;
let mods = KeyMods::CTRL | KeyMods::ALT;
assert!(mods.ctrl() && mods.alt() && !mods.shift());
assert_eq!(mods.without(KeyMods::ALT), KeyMods::CTRL);
assert!(KeyMods::NONE.is_empty());Tuple Fields§
§0: u8Implementations§
Trait Implementations§
impl Copy for KeyMods
impl Eq for KeyMods
impl StructuralPartialEq for KeyMods
Auto Trait Implementations§
impl Freeze for KeyMods
impl RefUnwindSafe for KeyMods
impl Send for KeyMods
impl Sync for KeyMods
impl Unpin for KeyMods
impl UnsafeUnpin for KeyMods
impl UnwindSafe for KeyMods
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.