pub trait Component {
// Required method
fn render<W: Write>(
&self,
writer: &mut W,
ctx: &RenderContext,
rng: &mut ThreadRng,
) -> Result<()>;
}Expand description
A self-rendering UI element.
Each component owns its visual state (positions, reveal progress, etc.)
and knows how to draw itself into a terminal writer. The wizard loop
acts as a thin compositor, calling render on each component in
z-order.
Required Methods§
fn render<W: Write>( &self, writer: &mut W, ctx: &RenderContext, rng: &mut ThreadRng, ) -> Result<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.