pub trait LineRenderable: Renderable {
// Required method
fn try_for_each_line<E>(
&self,
console: &Console,
options: &ConsoleOptions,
emit: impl FnMut(Vec<Segment>) -> Result<(), E>,
) -> Result<(), E>;
}Expand description
Optional line-streaming extension point for renderables.
Mirrors the incremental consumption of upstream’s rendering generators. Consumers can write each visual line immediately instead of collecting the complete segment stream. Implementations may still retain source data for measurement. This trait keeps streaming hooks out of inherent core APIs.
Required Methods§
Sourcefn try_for_each_line<E>(
&self,
console: &Console,
options: &ConsoleOptions,
emit: impl FnMut(Vec<Segment>) -> Result<(), E>,
) -> Result<(), E>
fn try_for_each_line<E>( &self, console: &Console, options: &ConsoleOptions, emit: impl FnMut(Vec<Segment>) -> Result<(), E>, ) -> Result<(), E>
Emit styled visual lines without trailing newlines, stopping immediately on the callback’s first error. An empty segment represents a blank line; calling the callback zero times represents no output.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".