#[repr(C)]pub struct LedEvent {
pub time: EventTime,
pub led: LedKind,
pub value: i32,
/* private fields */
}
Expand description
An event that indicates whether the specified LED should turn on/off.
Fields§
§time: EventTime
The timestamp associated with the event.
led: LedKind
The led associated with the event.
value: i32
The state of the led.
Implementations§
Source§impl<'a> LedEvent
impl<'a> LedEvent
Sourcepub const fn new(time: EventTime, led: LedKind, value: i32) -> Self
pub const fn new(time: EventTime, led: LedKind, value: i32) -> Self
Creates a new event from the given code and value.
Sourcepub unsafe fn from_event<E: AsRef<input_event>>(event: &E) -> &Self
pub unsafe fn from_event<E: AsRef<input_event>>(event: &E) -> &Self
Reinterpret a generic event without checking for validity.
Sourcepub unsafe fn from_event_mut(event: &mut InputEvent) -> &mut Self
pub unsafe fn from_event_mut(event: &mut InputEvent) -> &mut Self
Reinterpret a mutable generic event without checking for validity.
Sourcepub fn into_event(self) -> InputEvent
pub fn into_event(self) -> InputEvent
A generic input event.
Sourcepub fn as_event(&self) -> &InputEvent
pub fn as_event(&self) -> &InputEvent
A generic input event reference.
Sourcepub unsafe fn as_event_mut(&mut self) -> &mut InputEvent
pub unsafe fn as_event_mut(&mut self) -> &mut InputEvent
A mutable generic input event reference.
Trait Implementations§
Source§impl AsRef<InputEvent> for LedEvent
impl AsRef<InputEvent> for LedEvent
Source§fn as_ref(&self) -> &InputEvent
fn as_ref(&self) -> &InputEvent
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<input_event> for LedEvent
impl AsRef<input_event> for LedEvent
Source§fn as_ref(&self) -> &input_event
fn as_ref(&self) -> &input_event
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'de> Deserialize<'de> for LedEvent
impl<'de> Deserialize<'de> for LedEvent
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<'a> From<&'a LedEvent> for &'a InputEvent
impl<'a> From<&'a LedEvent> for &'a InputEvent
Source§impl<'a> From<&'a LedEvent> for InputEvent
impl<'a> From<&'a LedEvent> for InputEvent
Source§impl From<LedEvent> for InputEvent
impl From<LedEvent> for InputEvent
Source§impl GenericEvent for LedEvent
impl GenericEvent for LedEvent
Source§fn event_kind(&self) -> EventKind
fn event_kind(&self) -> EventKind
The event kind.
Source§fn with_event(event: InputEvent) -> Result<Self, RangeError>
fn with_event(event: InputEvent) -> Result<Self, RangeError>
Interprets a generic event into a concrete event type.
Source§unsafe fn with_event_unchecked(event: InputEvent) -> Self
unsafe fn with_event_unchecked(event: InputEvent) -> Self
Interprets a generic event into a concrete event type. Read more
Source§fn from_ref(event: &InputEvent) -> Result<&Self, RangeError>
fn from_ref(event: &InputEvent) -> Result<&Self, RangeError>
Interprets a generic event reference into a concrete event type.
Source§fn from_mut(event: &mut InputEvent) -> Result<&mut Self, RangeError>
fn from_mut(event: &mut InputEvent) -> Result<&mut Self, RangeError>
Interprets a mutable generic event reference into a concrete event type.
Source§impl Ord for LedEvent
impl Ord for LedEvent
Source§impl PartialOrd for LedEvent
impl PartialOrd for LedEvent
Source§impl<'a> TryFrom<&'a InputEvent> for &'a LedEvent
impl<'a> TryFrom<&'a InputEvent> for &'a LedEvent
Source§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
Source§impl<'a> TryFrom<&'a mut InputEvent> for &'a mut LedEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut LedEvent
Source§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
Source§impl TryFrom<InputEvent> for LedEvent
impl TryFrom<InputEvent> for LedEvent
Source§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
impl Copy for LedEvent
impl Eq for LedEvent
impl StructuralPartialEq for LedEvent
Auto Trait Implementations§
impl Freeze for LedEvent
impl RefUnwindSafe for LedEvent
impl Send for LedEvent
impl Sync for LedEvent
impl Unpin for LedEvent
impl UnwindSafe for LedEvent
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