Skip to main content

RenderSink

Trait RenderSink 

Source
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§

Source

fn visible_text(&mut self, text: &str)

Receives ordinary visible output.

Source

fn think_text(&mut self, text: &str)

Receives text produced inside a <think> block.

Provided Methods§

Source

fn tool_text(&mut self, text: &str)

Receives tool banner output (never markdown); defaults to visible.

Source

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>

Source§

fn visible_text(&mut self, text: &str)

Receives ordinary visible output.
Source§

fn think_text(&mut self, text: &str)

Receives text produced inside a <think> block.
Source§

fn tool_text(&mut self, text: &str)

Receives tool banner output (never markdown); defaults to visible.
Source§

fn error_text(&mut self, text: &str)

Receives error banners (e.g. [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.

Source§

fn visible_text(&mut self, text: &str)

Receives ordinary visible output.
Source§

fn think_text(&mut self, text: &str)

Receives text produced inside a <think> block.
Source§

fn tool_text(&mut self, text: &str)

Receives tool banner output (never markdown); defaults to visible.
Source§

fn error_text(&mut self, text: &str)

Receives error banners (e.g. [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.

Source§

fn visible_text(&mut self, text: &str)

Source§

fn think_text(&mut self, text: &str)

Source§

fn tool_text(&mut self, text: &str)

Source§

fn error_text(&mut self, text: &str)

Source§

impl RenderSink for Box<dyn RenderSink>

Source§

fn visible_text(&mut self, text: &str)

Source§

fn think_text(&mut self, text: &str)

Source§

fn tool_text(&mut self, text: &str)

Source§

fn error_text(&mut self, text: &str)

Implementors§