Enum input_linux::SwitchKind
source · #[repr(u16)]
pub enum SwitchKind {
Show 17 variants
Lid,
TabletMode,
HeadphoneInsert,
RfKillAll,
MicrophoneInsert,
Dock,
LineoutInsert,
JackPhysicalInsert,
VideoOutInsert,
CameraLensCover,
KeypadSlide,
FrontProximity,
RotateLock,
LineInInsert,
MuteDevice,
PenInserted,
MachineCover,
}
Expand description
Switch events.
Variants§
Lid
set = lid shut
TabletMode
set = tablet mode
HeadphoneInsert
set = inserted
RfKillAll
set = radio enabled
MicrophoneInsert
set = inserted
Dock
set = plugged into dock
LineoutInsert
set = inserted
JackPhysicalInsert
set = mechanical switch set
VideoOutInsert
set = inserted
CameraLensCover
set = lens covered
KeypadSlide
set = keypad slide out
FrontProximity
set = front proximity sensor active
RotateLock
set = rotate locked/disabled
LineInInsert
set = inserted
MuteDevice
set = device disabled
PenInserted
set = pen inserted
MachineCover
Implementations§
source§impl SwitchKind
impl SwitchKind
source§impl SwitchKind
impl SwitchKind
sourcepub fn from_code(code: u16) -> Result<Self, RangeError>
pub fn from_code(code: u16) -> Result<Self, RangeError>
Instantiates the enum from a raw code value.
Trait Implementations§
source§impl BitmaskTrait for SwitchKind
impl BitmaskTrait for SwitchKind
§type Index = SwitchKind
type Index = SwitchKind
The type that the bitmask can be indexed by.
source§fn array_default() -> Self::Array
fn array_default() -> Self::Array
The default empty state of the bitmask.
source§fn array_slice(array: &Self::Array) -> &[u8] ⓘ
fn array_slice(array: &Self::Array) -> &[u8] ⓘ
A representation of the bitmask as a slice of bytes.
source§impl Clone for SwitchKind
impl Clone for SwitchKind
source§fn clone(&self) -> SwitchKind
fn clone(&self) -> SwitchKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SwitchKind
impl Debug for SwitchKind
source§impl<'de> Deserialize<'de> for SwitchKind
impl<'de> Deserialize<'de> for SwitchKind
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
source§impl From<SwitchKind> for u16
impl From<SwitchKind> for u16
source§fn from(v: SwitchKind) -> Self
fn from(v: SwitchKind) -> Self
Converts to this type from the input type.
source§impl Hash for SwitchKind
impl Hash for SwitchKind
source§impl IterableEnum for SwitchKind
impl IterableEnum for SwitchKind
source§impl Ord for SwitchKind
impl Ord for SwitchKind
source§fn cmp(&self, other: &SwitchKind) -> Ordering
fn cmp(&self, other: &SwitchKind) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<SwitchKind> for SwitchKind
impl PartialEq<SwitchKind> for SwitchKind
source§fn eq(&self, other: &SwitchKind) -> bool
fn eq(&self, other: &SwitchKind) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<SwitchKind> for SwitchKind
impl PartialOrd<SwitchKind> for SwitchKind
source§fn partial_cmp(&self, other: &SwitchKind) -> Option<Ordering>
fn partial_cmp(&self, other: &SwitchKind) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more