pub trait TerminalEventSource: 'static {
// Required method
fn drain_events(&self) -> Vec<TerminalEvent>;
}Expand description
Pull source drained by the terminal during layout, paint, and input.
Implementations should return promptly; events are applied in returned order.
§Examples
use ailloli_ui_widgets::controls::{TerminalEvent, TerminalEventSource};
struct Empty;
impl TerminalEventSource for Empty { fn drain_events(&self) -> Vec<TerminalEvent> { Vec::new() } }
assert!(Empty.drain_events().is_empty());Required Methods§
Sourcefn drain_events(&self) -> Vec<TerminalEvent>
fn drain_events(&self) -> Vec<TerminalEvent>
Removes and returns currently pending events in application order.
§Examples
use ailloli_ui_widgets::controls::{TerminalEventBuffer, TerminalEventSource};
let source = TerminalEventBuffer::new();
assert!(source.drain_events().is_empty());