#[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.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Constraint
impl Debug for Constraint
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
Source§fn eq(&self, other: &Constraint) -> bool
fn eq(&self, other: &Constraint) -> bool
self and other values to be equal, and is used by ==.impl Copy for Constraint
impl Eq for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<C> WithAlpha for Cwhere
C: Copy,
impl<C> WithAlpha for Cwhere
C: Copy,
§fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
self with alpha, storing alpha before the color in memory
(see [AlphaFirst]).§fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
self with alpha, storing alpha after the color in memory
(see [AlphaLast]).