pub trait Measurable {
// Required methods
fn measure(&self, constraints: Constraints) -> Box<dyn Placeable>;
fn min_intrinsic_width(&self, height: f32) -> f32;
fn max_intrinsic_width(&self, height: f32) -> f32;
fn min_intrinsic_height(&self, width: f32) -> f32;
fn max_intrinsic_height(&self, width: f32) -> f32;
// Provided method
fn flex_parent_data(&self) -> Option<FlexParentData> { ... }
}Expand description
Object capable of measuring a layout child and exposing intrinsic sizes.
Required Methods§
Sourcefn measure(&self, constraints: Constraints) -> Box<dyn Placeable>
fn measure(&self, constraints: Constraints) -> Box<dyn Placeable>
Measures the child with the provided constraints, returning a Placeable.
Sourcefn min_intrinsic_width(&self, height: f32) -> f32
fn min_intrinsic_width(&self, height: f32) -> f32
Returns the minimum width achievable for the given height.
Sourcefn max_intrinsic_width(&self, height: f32) -> f32
fn max_intrinsic_width(&self, height: f32) -> f32
Returns the maximum width achievable for the given height.
Sourcefn min_intrinsic_height(&self, width: f32) -> f32
fn min_intrinsic_height(&self, width: f32) -> f32
Returns the minimum height achievable for the given width.
Sourcefn max_intrinsic_height(&self, width: f32) -> f32
fn max_intrinsic_height(&self, width: f32) -> f32
Returns the maximum height achievable for the given width.
Provided Methods§
Sourcefn flex_parent_data(&self) -> Option<FlexParentData>
fn flex_parent_data(&self) -> Option<FlexParentData>
Returns flex parent data if this measurable has weight/fill properties. Default implementation returns None (no weight).