pub enum Length {
Fill,
FillPortion(u16),
Shrink,
Fixed(f32),
}
Expand description
The strategy used to fill space in a specific dimension.
Variants§
Fill
Fill all the remaining space
FillPortion(u16)
Fill a portion of the remaining space relative to other elements.
Let’s say we have two elements: one with FillPortion(2)
and one with
FillPortion(3)
. The first will get 2 portions of the available space,
while the second one would get 3.
Length::Fill
is equivalent to Length::FillPortion(1)
.
Shrink
Fill the least amount of space
Fixed(f32)
Fill a fixed amount of space
Implementations§
Source§impl Length
impl Length
Sourcepub fn fill_factor(&self) -> u16
pub fn fill_factor(&self) -> u16
Returns the fill factor of the Length
.
The fill factor is a relative unit describing how much of the remaining space should be filled when compared to other elements. It is only meant to be used by layout engines.
Sourcepub fn is_fill(&self) -> bool
pub fn is_fill(&self) -> bool
Returns true
iff the Length
is either Length::Fill
or
Sourcepub fn fluid(&self) -> Self
pub fn fluid(&self) -> Self
Returns the “fluid” variant of the Length
.
Specifically:
Length::Shrink
ifLength::Shrink
orLength::Fixed
.Length::Fill
otherwise.