pub trait OutputChannel: Send + Sync {
// Required method
fn op_output(&self, line: &str);
// Provided methods
fn log(&self, level: LogLevel, message: &str) { ... }
fn raster(&self, frame: &str) { ... }
}Expand description
The single conduit for the one user terminal. Exactly one impl is
installed per run via install; producers submit to a bucket and
only the impl touches an fd. Every method is non-blocking.
Push 1 defines the op-output bucket only; log / status /
raster land in later pushes (SRD-87 §4).
Required Methods§
Provided Methods§
Sourcefn log(&self, level: LogLevel, message: &str)
fn log(&self, level: LogLevel, message: &str)
log bucket: project one diagnostic line to the live terminal
(SRD-87 §5). This is the output half only — the durable
session.log write and the fold-ring append are L1 intake, done by
observer::log_categorized before this is ever called, and the
sink_active/min_level gate (whether a line reaches the live
surface at all) stays with the observer. The default writes the
colorized line to stderr — the fd the channel owns. A sink-active
interactive run never reaches here (the sink renders from the ring);
a console-owning run never reaches here (suppressed upstream); piped
and bootstrap runs land here.
Sourcefn raster(&self, frame: &str)
fn raster(&self, frame: &str)
raster bucket: a fully-rendered, self-contained terminal frame (braille / ANSI cells) — e.g. the plotter’s canvas (SRD-87 §5). The producer owns layout (cursor controls, line endings); the channel owns the fd. The default writes the frame bytes raw to the stdout the channel owns — correct for a console-owning adapter (the plotter owns the screen) and for a piped plot redirected to a file.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".