pub trait BackendEventSource {
type Error: Debug + Display;
// Required methods
fn size(&self) -> Result<(u16, u16), Self::Error>;
fn set_features(
&mut self,
features: BackendFeatures,
) -> Result<(), Self::Error>;
fn poll_event(&mut self, timeout: Duration) -> Result<bool, Self::Error>;
fn read_event(&mut self) -> Result<Option<Event>, Self::Error>;
}Expand description
Event source abstraction: terminal size queries, feature toggles, and event I/O.
This is the input half of the backend boundary. The runtime polls this for
canonical Event values without knowing whether they come from crossterm,
raw Unix reads, or DOM events.
Required Associated Types§
Required Methods§
Sourcefn size(&self) -> Result<(u16, u16), Self::Error>
fn size(&self) -> Result<(u16, u16), Self::Error>
Query current terminal dimensions (columns, rows).
Sourcefn set_features(&mut self, features: BackendFeatures) -> Result<(), Self::Error>
fn set_features(&mut self, features: BackendFeatures) -> Result<(), Self::Error>
Enable or disable terminal features (mouse, paste, focus, kitty keyboard).
Backends must track current state and only emit escape sequences for changes.