#[non_exhaustive]pub enum Constraint {
Fixed(u16),
Percent(u16),
Ratio(u16, u16),
Fill(u16),
Min(u16),
Max(u16),
}Expand description
How a single pane claims space along the split axis.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Fixed(u16)
An exact number of cells.
Percent(u16)
A percentage (0–100) of the axis length.
Ratio(u16, u16)
A proportional share of the axis length, numerator / denominator, without picking
an arbitrary Fill weight. Resolves like Percent: a
fixed size computed up front, not a weighted share of the remainder. A zero
denominator resolves to zero rather than panicking.
Fill(u16)
Claim a share of whatever space the fixed/percent panes leave, proportional to
weight relative to the other Fill/Min/Max
panes in the same split (Min/Max panes always weigh 1).
Fill(1) reproduces plain equal distribution across an all-Fill split; a weight of
0 claims no share of the remainder.
Min(u16)
Like Fill, but guarantees at least this many cells even if the axis
is too small for every pane to get its share, and always weighs 1.
Max(u16)
Like Fill, but never grows past this many cells (any share past the
cap is left unclaimed rather than redistributed), and always weighs 1.