pub enum AppEvent {
Key(KeyEvent),
Tick,
Resize(u16, u16),
MouseScroll(i8),
Agent(AgentEvent),
Paste(String),
}Expand description
Top-level event consumed by the crate::App event handler.
Events arrive from two sources:
- Terminal input via
EventReader/CrosstermEventSource. - Agent output forwarded through
AgentEventbycrate::TuiChannel.
§Examples
use zeph_tui::event::AppEvent;
let ev = AppEvent::Tick;
assert!(matches!(ev, AppEvent::Tick));Variants§
Key(KeyEvent)
A keyboard event from crossterm.
Tick
Periodic tick used to drive animations and idle redraws.
Resize(u16, u16)
The terminal was resized to the given (columns, rows).
MouseScroll(i8)
Mouse wheel scroll: +1 = up, -1 = down.
Agent(AgentEvent)
An event forwarded from the agent event channel.
Paste(String)
Text pasted via bracketed paste mode.
The string may contain \n characters (multiline paste). The app
inserts it verbatim into the input buffer; Enter is still required
to submit (matching vim/neovim behaviour).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppEvent
impl !RefUnwindSafe for AppEvent
impl Send for AppEvent
impl Sync for AppEvent
impl Unpin for AppEvent
impl UnsafeUnpin for AppEvent
impl !UnwindSafe for AppEvent
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> 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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request