pub trait Renderable {
// Required method
fn render(&self, options: &ConsoleOptions) -> RenderResult;
// Provided method
fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement> { ... }
}Expand description
Trait for anything that can be rendered to the console.
Equivalent to __rich_console__ in Python Rich.
Required Methods§
fn render(&self, options: &ConsoleOptions) -> RenderResult
Provided Methods§
Sourcefn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
Optional width-measurement hook (equivalent to __rich_measure__).
Override to provide min/max width constraints for layout.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".