pub struct PressedKeyEvents<E, const M: usize = { MAX_KEY_EVENTS }>(/* private fields */);
Expand description
Events emitted when a Key is pressed.
Implementations§
Source§impl<E: Copy + Debug> PressedKeyEvents<E>
impl<E: Copy + Debug> PressedKeyEvents<E>
Sourcepub fn no_events() -> Self
pub fn no_events() -> Self
Constructs a PressedKeyEvents with no events scheduled.
Sourcepub fn event(event: Event<E>) -> Self
pub fn event(event: Event<E>) -> Self
Constructs a PressedKeyEvents with an immediate Event.
Sourcepub fn scheduled_event(sch_event: ScheduledEvent<E>) -> Self
pub fn scheduled_event(sch_event: ScheduledEvent<E>) -> Self
Constructs a PressedKeyEvents with an Event scheduled after a delay.
Sourcepub fn schedule_event(&mut self, delay: u16, event: Event<E>)
pub fn schedule_event(&mut self, delay: u16, event: Event<E>)
Adds an event with the schedule to the PressedKeyEvents.
Sourcepub fn extend(&mut self, other: PressedKeyEvents<E>)
pub fn extend(&mut self, other: PressedKeyEvents<E>)
Adds events from the other PressedKeyEvents to the PressedKeyEvents.
Sourcepub fn add_event(&mut self, ev: ScheduledEvent<E>)
pub fn add_event(&mut self, ev: ScheduledEvent<E>)
Adds an event from to the PressedKeyEvents.
Sourcepub fn map_events<F>(&self, f: fn(_: E) -> F) -> PressedKeyEvents<F>
pub fn map_events<F>(&self, f: fn(_: E) -> F) -> PressedKeyEvents<F>
Maps over the PressedKeyEvents.
Sourcepub fn into_events<F>(&self) -> PressedKeyEvents<F>where
E: Into<F>,
pub fn into_events<F>(&self) -> PressedKeyEvents<F>where
E: Into<F>,
Maps the PressedKeyEvents to a new type.
Trait Implementations§
Source§impl<E: Debug, const M: usize> IntoIterator for PressedKeyEvents<E, M>
impl<E: Debug, const M: usize> IntoIterator for PressedKeyEvents<E, M>
Source§type Item = ScheduledEvent<E>
type Item = ScheduledEvent<E>
The type of the elements being iterated over.
Source§type IntoIter = <Vec<ScheduledEvent<E>, M> as IntoIterator>::IntoIter
type IntoIter = <Vec<ScheduledEvent<E>, M> as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
impl<E: Eq, const M: usize> Eq for PressedKeyEvents<E, M>
impl<E, const M: usize> StructuralPartialEq for PressedKeyEvents<E, M>
Auto Trait Implementations§
impl<E, const M: usize> Freeze for PressedKeyEvents<E, M>where
E: Freeze,
impl<E, const M: usize> RefUnwindSafe for PressedKeyEvents<E, M>where
E: RefUnwindSafe,
impl<E, const M: usize> Send for PressedKeyEvents<E, M>where
E: Send,
impl<E, const M: usize> Sync for PressedKeyEvents<E, M>where
E: Sync,
impl<E, const M: usize> Unpin for PressedKeyEvents<E, M>where
E: Unpin,
impl<E, const M: usize> UnwindSafe for PressedKeyEvents<E, M>where
E: UnwindSafe,
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