pub trait ReadoutBuf {
// Required method
fn write_str(&mut self, s: &str) -> Result;
// Provided method
fn reserve(&mut self, _additional: usize) { ... }
}Expand description
Append-only write surface a readout writes its rendered piece into. Implementations decide how to handle styling (ANSI inline vs. typed style runs) and ANSI stripping (TTY vs. non-TTY sinks).
The trait is intentionally minimal — write_str is
enough for the Push 1 built-in. Later pushes will extend
it with style-run pushes (push_styled) once the colour
/ style sub-language lands; until then, readouts emit
ANSI escapes as part of write_str payloads when they
want styling, and the buffer’s own ANSI policy decides
whether to keep or strip.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".