pub enum EzEvent<CID, CM>{
}Expand description
All the events that can be sent across the application.
Your custom events will be wrapped inside EzEvent::Client.
Variants§
Keyboard(KeyEvent)
A keyboard event from crossterm
Mouse(MouseEvent)
A mouse event from crossterm
WindowResize(u16, u16)
A window resize event from crossterm
ForceFocus(EzCptId<CID>)
Force the focus to a given component ID.
ForceBlur()
Force the blur of the current focused component.
FocusGained
A focus gained event from crossterm. This is unrelated to the focus in-app; it means the terminal holding your app received focus from your window manager.
FocusLost
A focus lost event from crossterm. This is unrelated to the focus in-app; it means the terminal holding your app received focus from your window manager.
Paste(String)
A paste event from crossterm
Init
The event send after app is started
Tick
The event send on each tick (not used by the lib)
Render
The event send to trigger a render
Quit
The vent sent to order the app to gracefully exit
None
An empty event to be returned when no event is emited, but we want to prevent the default app event handling (focus/quit)
Error(Error)
Sent when an unexpected error occurs
UpdateLegend(String, Vec<Matcher>)
Set the dynamic legend
Client(CM)
Wraps any events related to your business logic.
Implementations§
Source§impl<CID, CM> EzEvent<CID, CM>
impl<CID, CM> EzEvent<CID, CM>
Source§impl<CID, CM> EzEvent<CID, CM>
impl<CID, CM> EzEvent<CID, CM>
Sourcepub fn try_original(&self) -> Option<CrosstermEvent>
pub fn try_original(&self) -> Option<CrosstermEvent>
Try to convert this event to a crossterm event.
Trait Implementations§
impl<CID, CM> Eq for EzEvent<CID, CM>
Source§impl<CID, CM> From<Event> for EzEvent<CID, CM>
Convert a crossterm event to a Event.
Only the key events are not a one to one conversion;
we have to differentiate between key press, key repeat, and key release.
impl<CID, CM> From<Event> for EzEvent<CID, CM>
Convert a crossterm event to a Event.
Only the key events are not a one to one conversion;
we have to differentiate between key press, key repeat, and key release.
Source§fn from(event: CrosstermEvent) -> Self
fn from(event: CrosstermEvent) -> Self
impl<CID, CM> StructuralPartialEq for EzEvent<CID, CM>
Auto Trait Implementations§
impl<CID, CM> Freeze for EzEvent<CID, CM>
impl<CID, CM> RefUnwindSafe for EzEvent<CID, CM>
impl<CID, CM> Send for EzEvent<CID, CM>
impl<CID, CM> Sync for EzEvent<CID, CM>
impl<CID, CM> Unpin for EzEvent<CID, CM>
impl<CID, CM> UnsafeUnpin for EzEvent<CID, CM>
impl<CID, CM> UnwindSafe for EzEvent<CID, CM>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more