Skip to main content

ReadoutSink

Trait ReadoutSink 

Source
pub trait ReadoutSink {
    // Required methods
    fn literal(&mut self, s: &str);
    fn render(
        &mut self,
        readout: ReadoutHandle,
        ctx: &dyn ReadoutContext,
        lod: Lod,
        mode: ContentMode,
        options: &ReadoutOptions,
        layout: LayoutHint,
    );
    fn line_break(&mut self);
}
Expand description

Layout-aware writer the binder drives. Push 3 ships StringSink for terminal-mode line emission; Push 5 adds a TUI sink that holds Vec<Span>.

Required Methods§

Source

fn literal(&mut self, s: &str)

Emit a literal run of text. Lives between readout renders; honours no layout rule on its own — the surrounding renders do.

Source

fn render( &mut self, readout: ReadoutHandle, ctx: &dyn ReadoutContext, lod: Lod, mode: ContentMode, options: &ReadoutOptions, layout: LayoutHint, )

Render readout against ctx. The sink applies layout per its surface conventions before / after invoking readout.render().

Source

fn line_break(&mut self)

Force a line break independent of layout.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§