Skip to main content

Measure

Trait Measure 

Source
pub trait Measure {
    // Required method
    fn height_for(&self, width: u16) -> u16;
}
Expand description

A widget that can report the height it needs for a given width, before ever being rendered.

Lets a caller size a pane to fit content (e.g. a wrapped Paragraph, behind the egc feature) instead of guessing a fixed height up front. Independent of any Backend: sizing is pure content math, not drawing.

Required Methods§

Source

fn height_for(&self, width: u16) -> u16

The number of rows this widget would need to render at width columns.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§