pub struct TerminalSink<W: Write> { /* private fields */ }Expand description
Routes viz output into the markdown token renderer.
Implementations§
Source§impl<W: Write> TerminalSink<W>
impl<W: Write> TerminalSink<W>
Sourcepub fn new(renderer: TokenRenderer<W>) -> Self
pub fn new(renderer: TokenRenderer<W>) -> Self
Wraps a token renderer as a RenderSink.
Sourcepub fn renderer_mut(&mut self) -> &mut TokenRenderer<W>
pub fn renderer_mut(&mut self) -> &mut TokenRenderer<W>
Borrows the underlying renderer, for callers that need to drive it
directly (fence handling, capture, finish).
Sourcepub fn into_renderer(self) -> TokenRenderer<W>
pub fn into_renderer(self) -> TokenRenderer<W>
Consumes the sink and returns the renderer.
Trait Implementations§
Source§impl<W: Write> RenderSink for TerminalSink<W>
impl<W: Write> RenderSink for TerminalSink<W>
Source§fn visible_text(&mut self, text: &str)
fn visible_text(&mut self, text: &str)
Receives ordinary visible output.
Source§fn think_text(&mut self, text: &str)
fn think_text(&mut self, text: &str)
Receives text produced inside a
<think> block.Source§fn tool_text(&mut self, text: &str)
fn tool_text(&mut self, text: &str)
Receives tool banner output (never markdown); defaults to visible.
Source§fn 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.Auto Trait Implementations§
impl<W> Freeze for TerminalSink<W>where
TokenRenderer<W>: Freeze,
impl<W> RefUnwindSafe for TerminalSink<W>where
TokenRenderer<W>: RefUnwindSafe,
impl<W> Send for TerminalSink<W>where
TokenRenderer<W>: Send,
impl<W> Sync for TerminalSink<W>where
TokenRenderer<W>: Sync,
impl<W> Unpin for TerminalSink<W>where
TokenRenderer<W>: Unpin,
impl<W> UnsafeUnpin for TerminalSink<W>where
TokenRenderer<W>: UnsafeUnpin,
impl<W> UnwindSafe for TerminalSink<W>where
TokenRenderer<W>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more