#[non_exhaustive]pub enum Event {
Show 13 variants
RxBytes(Bytes),
TxBytes(Bytes),
Command(Command),
DeviceConnected,
DeviceDisconnected {
reason: String,
},
ConfigChanged(SerialConfig),
SystemMessage(String),
Error(Arc<Error>),
MenuOpened,
MenuClosed,
ProfileSaved {
path: PathBuf,
},
ProfileLoadFailed {
path: PathBuf,
error: Arc<Error>,
},
ModemLinesChanged {
dtr: bool,
rts: bool,
},
}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.
MenuOpened
The TUI menu opened. Informational signal so log writers / scripts can react (e.g., pause disk flushing while the UI is interactive).
MenuClosed
The TUI menu closed.
ProfileSaved
A profile was successfully written to disk.
ProfileLoadFailed
A profile read or write failed. The session continues with the last-known-good configuration; subscribers surface this to the user (e.g. as a toast) but must not treat it as fatal.
Fields
ModemLinesChanged
DTR / RTS output-line state changed. Published by the session
after a successful
ToggleDtr /
ToggleRts /
SetDtrAbs /
SetRtsAbs dispatch so
subscribers (notably the TUI) can refresh their cached
ModemLineSnapshot without
re-reading the device.