#[non_exhaustive]pub enum Event {
RxBytes(Bytes),
TxBytes(Bytes),
Command(Command),
DeviceConnected,
DeviceDisconnected {
reason: String,
},
ConfigChanged(SerialConfig),
SystemMessage(String),
Error(Arc<Error>),
}Expand description
One unit of work that flowed through (or originated inside) a session.
#[non_exhaustive] so future variants (UserInput, Command, …)
added in later issues do not break downstream code that matches.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RxBytes(Bytes)
Bytes just read from the serial device.
TxBytes(Bytes)
Bytes pending transmission to the serial device. Publishing this asks the writer task to send them.
Command(Command)
A runtime command produced by the keyboard state machine (Issue #6); subscribed by the command-handler dispatcher in Issue #7.
DeviceConnected
The session opened the device and is ready to do I/O.
DeviceDisconnected
The session lost the device (EOF, write failure, hot-unplug).
ConfigChanged(SerialConfig)
The serial configuration changed at runtime (e.g. ^T b 9600).
SystemMessage(String)
Human-readable status text emitted by the session itself
(Help banner, ShowConfig, line-toggle acknowledgements, …).
The terminal renderer renders these with a *** rtcom: prefix
to keep them distinct from serial data; log writers
(Issue #10) must drop them so they do not pollute capture
files.
Error(Arc<Error>)
A non-fatal error worth surfacing to subscribers. Wrapped in Arc
so the broadcast channel can clone it cheaply across receivers.