#[non_exhaustive]pub enum Track {
Fit,
Px(f32),
Percent(f32),
Fill(f32),
MinMax {
min: f32,
max: Box<Track>,
},
}Expand description
Size of a single grid column or row.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Fit
Size to the content of the track.
Px(f32)
Fixed size in logical pixels.
Percent(f32)
Size as a percentage of the available space.
Fill(f32)
Share of the free space, proportional to the weight.
MinMax
Combination of a minimum size and a maximum track definition.
Implementations§
Source§impl Track
impl Track
Sourcepub fn minmax(min: f32, max: Track) -> Track
pub fn minmax(min: f32, max: Track) -> Track
Creates a track with a minimum size and a maximum definition.
Nested Track::MinMax maximums are flattened to their inner track.
Sourcepub fn is_fill_like(&self) -> bool
pub fn is_fill_like(&self) -> bool
Returns true if the track claims free space.
Sourcepub fn fill_weight(&self) -> f32
pub fn fill_weight(&self) -> f32
Returns the weight used to share free space, or zero.
Trait Implementations§
impl StructuralPartialEq for Track
Auto Trait Implementations§
impl Freeze for Track
impl RefUnwindSafe for Track
impl Send for Track
impl Sync for Track
impl Unpin for Track
impl UnsafeUnpin for Track
impl UnwindSafe for Track
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
Mutably borrows from an owned value. Read more