pub trait IntrinsicMeasure: Send + Sync {
// Required method
fn measure(
&self,
known: (Option<f32>, Option<f32>),
available: (AvailableSpace, AvailableSpace),
) -> (f32, f32);
}Expand description
Trait implemented by leaves whose intrinsic size depends on their content. Called by taffy during layout.
Required Methods§
Sourcefn measure(
&self,
known: (Option<f32>, Option<f32>),
available: (AvailableSpace, AvailableSpace),
) -> (f32, f32)
fn measure( &self, known: (Option<f32>, Option<f32>), available: (AvailableSpace, AvailableSpace), ) -> (f32, f32)
Measure intrinsic size given the available width/height.
Either side may be None if unconstrained (e.g. min-content pass).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".