pub struct KeyEvents<E, const M: usize = { MAX_KEY_EVENTS }>(/* private fields */);
Expand description
Events emitted when a Key is pressed.
Implementations§
Source§impl<E: Copy + Debug> KeyEvents<E>
impl<E: Copy + Debug> KeyEvents<E>
Sourcepub fn scheduled_event(sch_event: ScheduledEvent<E>) -> Self
pub fn scheduled_event(sch_event: ScheduledEvent<E>) -> Self
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 KeyEvents.
Sourcepub fn add_event(&mut self, ev: ScheduledEvent<E>)
pub fn add_event(&mut self, ev: ScheduledEvent<E>)
Adds an event from to the KeyEvents.
Sourcepub fn map_events<F>(&self, f: fn(E) -> F) -> KeyEvents<F>
pub fn map_events<F>(&self, f: fn(E) -> F) -> KeyEvents<F>
Maps over the KeyEvents.
Sourcepub fn into_events<F>(&self) -> KeyEvents<F>where
E: Into<F>,
pub fn into_events<F>(&self) -> KeyEvents<F>where
E: Into<F>,
Maps the KeyEvents to a new type.
Trait Implementations§
Source§impl<E: Debug, const M: usize> IntoIterator for KeyEvents<E, M>
impl<E: Debug, const M: usize> IntoIterator for KeyEvents<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 KeyEvents<E, M>
impl<E, const M: usize> StructuralPartialEq for KeyEvents<E, M>
Auto Trait Implementations§
impl<E, const M: usize> Freeze for KeyEvents<E, M>where
E: Freeze,
impl<E, const M: usize> RefUnwindSafe for KeyEvents<E, M>where
E: RefUnwindSafe,
impl<E, const M: usize> Send for KeyEvents<E, M>where
E: Send,
impl<E, const M: usize> Sync for KeyEvents<E, M>where
E: Sync,
impl<E, const M: usize> Unpin for KeyEvents<E, M>where
E: Unpin,
impl<E, const M: usize> UnwindSafe for KeyEvents<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