pub struct EventProcessor;Expand description
Processes raw crossterm events into hojicha events
Implementations§
Source§impl EventProcessor
impl EventProcessor
Sourcepub fn process_crossterm_event(event: CrosstermEvent) -> Option<Event<()>>
pub fn process_crossterm_event(event: CrosstermEvent) -> Option<Event<()>>
Process a crossterm event into a hojicha event
Sourcepub fn coalesce_resize_events(
initial_width: u16,
initial_height: u16,
rx: &Receiver<CrosstermEvent>,
) -> (u16, u16)
pub fn coalesce_resize_events( initial_width: u16, initial_height: u16, rx: &Receiver<CrosstermEvent>, ) -> (u16, u16)
Coalesce multiple resize events into one
Sourcepub fn is_quit_event<M>(event: &Event<M>) -> bool
pub fn is_quit_event<M>(event: &Event<M>) -> bool
Check if an event is a quit event (Ctrl+Q)
Sourcepub fn is_suspend_event<M>(event: &Event<M>) -> bool
pub fn is_suspend_event<M>(event: &Event<M>) -> bool
Check if an event is a suspend event (Ctrl+Z)
Sourcepub fn prioritize_events<M>(
message_rx: &Receiver<Event<M>>,
crossterm_rx: &Receiver<CrosstermEvent>,
tick_rate: Duration,
) -> Option<Event<M>>where
M: Clone,
pub fn prioritize_events<M>(
message_rx: &Receiver<Event<M>>,
crossterm_rx: &Receiver<CrosstermEvent>,
tick_rate: Duration,
) -> Option<Event<M>>where
M: Clone,
Prioritize and merge events from multiple channels
Auto Trait Implementations§
impl Freeze for EventProcessor
impl RefUnwindSafe for EventProcessor
impl Send for EventProcessor
impl Sync for EventProcessor
impl Unpin for EventProcessor
impl UnwindSafe for EventProcessor
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
Source§impl<T> Inspectable for T
impl<T> Inspectable for T
Source§fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
Conditionally inspect this value
Source§fn inspect_with<F>(self, label: &str, f: F) -> Self
fn inspect_with<F>(self, label: &str, f: F) -> Self
Inspect with a custom formatter