#[non_exhaustive]#[repr(u8)]pub enum ButtonState {
Inactive = 0,
Press = 1,
ShortPressActive = 2,
LongPress = 3,
LongPressActive = 4,
Release = 5,
}Expand description
Crown button state reported in a CrownUpdate.
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.
Inactive = 0
Inactive (or not diverted).
Press = 1
Press started.
ShortPressActive = 2
Short press active.
LongPress = 3
Long press reached the time threshold.
LongPressActive = 4
Long press active.
Release = 5
Released.
Trait Implementations§
Source§impl Clone for ButtonState
impl Clone for ButtonState
Source§fn clone(&self) -> ButtonState
fn clone(&self) -> ButtonState
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 ButtonState
Source§impl Debug for ButtonState
impl Debug for ButtonState
impl Eq for ButtonState
Source§impl From<ButtonState> for u8
impl From<ButtonState> for u8
Source§fn from(enum_value: ButtonState) -> Self
fn from(enum_value: ButtonState) -> Self
Converts to this type from the input type.
Source§impl Hash for ButtonState
impl Hash for ButtonState
Source§impl PartialEq for ButtonState
impl PartialEq for ButtonState
impl StructuralPartialEq for ButtonState
Source§impl TryFrom<u8> for ButtonState
impl TryFrom<u8> for ButtonState
Source§type Error = TryFromPrimitiveError<ButtonState>
type Error = TryFromPrimitiveError<ButtonState>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for ButtonState
impl TryFromPrimitive for ButtonState
const NAME: &'static str = "ButtonState"
type Primitive = u8
type Error = TryFromPrimitiveError<ButtonState>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations§
impl Freeze for ButtonState
impl RefUnwindSafe for ButtonState
impl Send for ButtonState
impl Sync for ButtonState
impl Unpin for ButtonState
impl UnsafeUnpin for ButtonState
impl UnwindSafe for ButtonState
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