#[non_exhaustive]pub enum HeightSpec {
Auto,
Fixed(u32),
Pct(u8),
Ratio(u16, u16),
MinMax {
min: u32,
max: u32,
},
}Expand description
Height specification for a flexbox item.
Mirror of WidthSpec for the cross axis. See WidthSpec for full
variant semantics, including the sentinel encoding of Self::MinMax.
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.
Auto
Unconstrained — sizes from content and available space.
Fixed(u32)
Exact cell height.
Pct(u8)
Percentage of parent height (0..=100).
Ratio(u16, u16)
Exact integer fraction of parent (numerator, denominator).
Ratio(1, 3) produces area / 3. Floor division — for
area = 80, num = 1, den = 3 → 26. A den of 0 is treated as
no constraint.
MinMax
Min and/or max bounds. Sentinels: min = 0 and max = u32::MAX
represent “no bound”. See WidthSpec::MinMax for full rationale.
Trait Implementations§
Source§impl Clone for HeightSpec
impl Clone for HeightSpec
Source§fn clone(&self) -> HeightSpec
fn clone(&self) -> HeightSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HeightSpec
impl Debug for HeightSpec
Source§impl Default for HeightSpec
impl Default for HeightSpec
Source§impl<'de> Deserialize<'de> for HeightSpec
impl<'de> Deserialize<'de> for HeightSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for HeightSpec
impl Hash for HeightSpec
Source§impl PartialEq for HeightSpec
impl PartialEq for HeightSpec
Source§impl Serialize for HeightSpec
impl Serialize for HeightSpec
impl Copy for HeightSpec
impl Eq for HeightSpec
impl StructuralPartialEq for HeightSpec
Auto Trait Implementations§
impl Freeze for HeightSpec
impl RefUnwindSafe for HeightSpec
impl Send for HeightSpec
impl Sync for HeightSpec
impl Unpin for HeightSpec
impl UnsafeUnpin for HeightSpec
impl UnwindSafe for HeightSpec
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