#[repr(u16)]pub enum SwitchKind {
Show 17 variants
Lid = 0,
TabletMode = 1,
HeadphoneInsert = 2,
RfKillAll = 3,
MicrophoneInsert = 4,
Dock = 5,
LineoutInsert = 6,
JackPhysicalInsert = 7,
VideoOutInsert = 8,
CameraLensCover = 9,
KeypadSlide = 10,
FrontProximity = 11,
RotateLock = 12,
LineInInsert = 13,
MuteDevice = 14,
PenInserted = 15,
MachineCover = 16,
}
Expand description
Switch events.
Variants§
Lid = 0
set = lid shut
TabletMode = 1
set = tablet mode
HeadphoneInsert = 2
set = inserted
RfKillAll = 3
set = radio enabled
MicrophoneInsert = 4
set = inserted
Dock = 5
set = plugged into dock
LineoutInsert = 6
set = inserted
JackPhysicalInsert = 7
set = mechanical switch set
VideoOutInsert = 8
set = inserted
CameraLensCover = 9
set = lens covered
KeypadSlide = 10
set = keypad slide out
FrontProximity = 11
set = front proximity sensor active
RotateLock = 12
set = rotate locked/disabled
LineInInsert = 13
set = inserted
MuteDevice = 14
set = device disabled
PenInserted = 15
set = pen inserted
MachineCover = 16
Implementations§
Source§impl SwitchKind
impl SwitchKind
Sourcepub fn iter() -> EnumIterator<Self> ⓘ
pub fn iter() -> EnumIterator<Self> ⓘ
An iterator over all values of the enum.
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
Source§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 for SwitchKind
impl PartialEq for SwitchKind
Source§impl PartialOrd for SwitchKind
impl PartialOrd for SwitchKind
Source§impl Serialize for SwitchKind
impl Serialize for SwitchKind
Source§impl TryFrom<u16> for SwitchKind
impl TryFrom<u16> for SwitchKind
impl Copy for SwitchKind
impl Eq for SwitchKind
impl StructuralPartialEq for SwitchKind
Auto Trait Implementations§
impl Freeze for SwitchKind
impl RefUnwindSafe for SwitchKind
impl Send for SwitchKind
impl Sync for SwitchKind
impl Unpin for SwitchKind
impl UnwindSafe for SwitchKind
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