pub struct KeyModifiers { /* private fields */ }Expand description
Modifier flags that may accompany an SDK KeyEvent.
The bitfield mirrors the modifiers that survive tmux-compatible attach translation (Shift, Control, Alt, Super, Hyper, Meta) without adopting any single host library’s encoding. Unknown bits are rejected at construction time so deserialized values cannot smuggle reserved bits through the SDK boundary.
Implementations§
Source§impl KeyModifiers
impl KeyModifiers
Sourcepub const fn from_bits(bits: u8) -> Option<Self>
pub const fn from_bits(bits: u8) -> Option<Self>
Constructs modifiers from a bitfield, rejecting reserved bits.
Sourcepub const fn from_bits_truncate(bits: u8) -> Self
pub const fn from_bits_truncate(bits: u8) -> Self
Constructs modifiers from a bitfield, dropping any reserved bits.
Sourcepub const fn contains(self, other: Self) -> bool
pub const fn contains(self, other: Self) -> bool
Returns true when every bit in other is also set in self.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection of self and other.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference of self and other.
Trait Implementations§
Source§impl BitAnd for KeyModifiers
impl BitAnd for KeyModifiers
Source§impl BitOr for KeyModifiers
impl BitOr for KeyModifiers
Source§impl BitXor for KeyModifiers
impl BitXor for KeyModifiers
Source§impl Clone for KeyModifiers
impl Clone for KeyModifiers
Source§fn clone(&self) -> KeyModifiers
fn clone(&self) -> KeyModifiers
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for KeyModifiers
Source§impl Debug for KeyModifiers
impl Debug for KeyModifiers
Source§impl Default for KeyModifiers
impl Default for KeyModifiers
Source§fn default() -> KeyModifiers
fn default() -> KeyModifiers
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KeyModifiers
impl<'de> Deserialize<'de> for KeyModifiers
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for KeyModifiers
Source§impl Hash for KeyModifiers
impl Hash for KeyModifiers
Source§impl PartialEq for KeyModifiers
impl PartialEq for KeyModifiers
Source§fn eq(&self, other: &KeyModifiers) -> bool
fn eq(&self, other: &KeyModifiers) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for KeyModifiers
impl Serialize for KeyModifiers
impl StructuralPartialEq for KeyModifiers
Auto Trait Implementations§
impl Freeze for KeyModifiers
impl RefUnwindSafe for KeyModifiers
impl Send for KeyModifiers
impl Sync for KeyModifiers
impl Unpin for KeyModifiers
impl UnsafeUnpin for KeyModifiers
impl UnwindSafe for KeyModifiers
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