pub trait RenderSink {
// Required methods
fn visible_text(&mut self, text: &str);
fn think_text(&mut self, text: &str);
// Provided methods
fn tool_text(&mut self, text: &str) { ... }
fn error_text(&mut self, text: &str) { ... }
}Expand description
Destination for rendered output; the UI layer routes this to its renderer.
The stream renderer never emits raw DSML through this trait: DSML bytes are
replaced by tool banners, which always arrive via
visible_text.
This trait is also the animation boundary. Motion is Ratatui-only: the
Ratatui sink drives plank’s animation module effects (throbber, shimmer, pulse,
flash, stall-fade) off the shared 20 Hz clock, while the plain-stdout and
--non-interactive sinks render the static/reduced-motion form. The stream
renderer feeds bytes through here without knowing which sink animates, so the
plain path stays untouched.
Required Methods§
Sourcefn visible_text(&mut self, text: &str)
fn visible_text(&mut self, text: &str)
Receives ordinary visible output.
Sourcefn think_text(&mut self, text: &str)
fn think_text(&mut self, text: &str)
Receives text produced inside a <think> block.
Provided Methods§
Sourcefn tool_text(&mut self, text: &str)
fn tool_text(&mut self, text: &str)
Receives tool banner output (never markdown); defaults to visible.
Sourcefn error_text(&mut self, text: &str)
fn error_text(&mut self, text: &str)
Receives error banners (e.g. [invalid tool call: ...]); sinks should
style these red. Defaults to tool text.
Trait Implementations§
Source§impl RenderSink for Box<dyn RenderSink>
impl RenderSink for Box<dyn RenderSink>
Source§fn visible_text(&mut self, text: &str)
fn visible_text(&mut self, text: &str)
Source§fn think_text(&mut self, text: &str)
fn think_text(&mut self, text: &str)
<think> block.Source§fn tool_text(&mut self, text: &str)
fn tool_text(&mut self, text: &str)
Source§fn error_text(&mut self, text: &str)
fn error_text(&mut self, text: &str)
[invalid tool call: ...]); sinks should
style these red. Defaults to tool text.Source§impl RenderSink for Box<dyn RenderSink + Send>
The Send flavour, for a sink that has to cross into a scoped thread — a
parallel sub-agent fan-out drives several generations at once, each writing
through its own sink.
impl RenderSink for Box<dyn RenderSink + Send>
The Send flavour, for a sink that has to cross into a scoped thread — a
parallel sub-agent fan-out drives several generations at once, each writing
through its own sink.
Source§fn visible_text(&mut self, text: &str)
fn visible_text(&mut self, text: &str)
Source§fn think_text(&mut self, text: &str)
fn think_text(&mut self, text: &str)
<think> block.Source§fn tool_text(&mut self, text: &str)
fn tool_text(&mut self, text: &str)
Source§fn error_text(&mut self, text: &str)
fn error_text(&mut self, text: &str)
[invalid tool call: ...]); sinks should
style these red. Defaults to tool text.Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl RenderSink for Box<dyn RenderSink + Send>
The Send flavour, for a sink that has to cross into a scoped thread — a
parallel sub-agent fan-out drives several generations at once, each writing
through its own sink.
impl RenderSink for Box<dyn RenderSink + Send>
The Send flavour, for a sink that has to cross into a scoped thread — a
parallel sub-agent fan-out drives several generations at once, each writing
through its own sink.