pub trait Layout {
// Required methods
fn measure(
&self,
children: &[DesiredSize],
constraints: SizeConstraints,
) -> DesiredSize;
fn arrange(&self, children: &[DesiredSize], area: Rect) -> Vec<Rect>;
}Expand description
Trait implemented by all layout algorithms.
A layout receives a set of child sizes and an available area, then
computes the final Rect for each child.
Required Methods§
Sourcefn measure(
&self,
children: &[DesiredSize],
constraints: SizeConstraints,
) -> DesiredSize
fn measure( &self, children: &[DesiredSize], constraints: SizeConstraints, ) -> DesiredSize
Compute the desired size of this layout given child sizes and constraints.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".