pub trait Layoutable {
// Required methods
fn measure(&self, ctx: &LayoutCtx<'_>, constraints: Constraints) -> Size;
fn layout(
&self,
ctx: &LayoutCtx<'_>,
area: Rect,
warnings: &mut Vec<LayoutWarning>,
page: usize,
) -> LayoutResult;
}Expand description
measure/layout. Implemented for every
concrete element type (not Element variants with todo!(), since all
V1-through-Phase-2 variants are implemented) plus a dispatching impl on
Element itself so containers can recurse over Vec<Element> children.
Required Methods§
fn measure(&self, ctx: &LayoutCtx<'_>, constraints: Constraints) -> Size
fn layout( &self, ctx: &LayoutCtx<'_>, area: Rect, warnings: &mut Vec<LayoutWarning>, page: usize, ) -> LayoutResult
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".