#[non_exhaustive]#[repr(u32)]pub enum Switch {
Lid = 1,
TabletMode = 2,
}
Expand description
Types of Switches
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.
Lid = 1
The laptop lid was closed when the SwitchState
is
On
, or was opened when it is Off
TabletMode = 2
This switch indicates whether the device is in normal laptop mode or behaves like a tablet-like device where the primary interaction is usually a touch screen. When in tablet mode, the keyboard and touchpad are usually inaccessible.
If the switch is in state SwitchState::Off
, the
device is in laptop mode. If the switch is in state
SwitchState::On
, the device is in tablet mode and the
keyboard or touchpad may not be accessible.
It is up to the caller to identify which devices are inaccessible `in tablet mode.
Trait Implementations§
impl Copy for Switch
impl Eq for Switch
impl StructuralPartialEq for Switch
Auto Trait Implementations§
impl Freeze for Switch
impl RefUnwindSafe for Switch
impl Send for Switch
impl Sync for Switch
impl Unpin for Switch
impl UnwindSafe for Switch
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