pub trait Widget {
// Required method
fn create_graphemes(&self) -> CreatedGraphemes;
// Provided method
fn create_graphemes_in_viewport(
&self,
_width: u16,
_height: u16,
) -> CreatedGraphemes { ... }
}Expand description
Projects widget state into width-independent styled content.
Required Methods§
Sourcefn create_graphemes(&self) -> CreatedGraphemes
fn create_graphemes(&self) -> CreatedGraphemes
Creates the widget’s complete content.
Provided Methods§
Sourcefn create_graphemes_in_viewport(
&self,
_width: u16,
_height: u16,
) -> CreatedGraphemes
fn create_graphemes_in_viewport( &self, _width: u16, _height: u16, ) -> CreatedGraphemes
Creates content bounded by a terminal viewport.
The default implementation returns the complete content. Large widgets can override this method to avoid projecting rows that cannot be shown. Wrapping and truncation remain the renderer’s responsibility.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".