pub trait MicroRenderer: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn render(
&self,
placement: &Placement<'_>,
console: &Console,
) -> Option<Vec<Segment>>;
}Expand description
Draws a placement. Implementations must return segments whose visible
width (control segments count zero) is exactly placement.meta.cols, or
None to pass. Anything else is ignored and the fallback stays.
A two-row asset is offered one row at a time, top first
(placement.meta.row is 0, then 1), and drawn only when the same
renderer draws both: an image drawn at the cursor goes with the last row,
moving the cursor up to the first. The rows are printed on consecutive
lines at the same column.
Return only what the target can show: a renderer is picked per console,
and the console’s capabilities are the renderer’s to check. Keep the tag
on visible cells (Placement::style) so later passes can still find
the asset.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".