pub trait RichSink {
// Required methods
fn run(&mut self, style: Style, text: &str);
fn newline(&mut self);
// Provided method
fn soft_wrap(&mut self) { ... }
}Expand description
Receives styled runs and row breaks. run text contains neither newlines
nor escapes; external ANSI text must cross decompose exactly once.
Required Methods§
Provided Methods§
Sourcefn soft_wrap(&mut self)
fn soft_wrap(&mut self)
Completes the current row at a mid-word soft wrap: the text continues on the next row purely because it hit the layout width, with no whitespace collapsed at the break.
Provenance-tracking sinks keep the boundary joinable so the renderer
can re-join it with terminal autowrap; the default treats it as a
RichSink::newline.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl RichSink for String
ANSI-materializing boundary sink.
impl RichSink for String
ANSI-materializing boundary sink.
Each run carries a complete style prefix, so a String has no hidden style
state. Text passed to this sink is escape-free by the RichSink contract.