pub enum GridTrack {
Fr(f32),
Keyword(GridTrackKeyword),
Length(LengthPercentage),
Minmax {
min: Box<GridTrack>,
max: Box<GridTrack>,
},
}Expand description
A single grid track (column or row) sizing function.
Variant order matters here: this is #[serde(untagged)], and serde tries
each variant in declaration order, keeping the first that deserializes
successfully. Length(LengthPercentage) accepts any JSON number or
string (its own String fallback variant is a catch-all), so it must be
tried last — otherwise it silently swallows bare numbers (meant to be
Fr, matching the flex-grow convention) and keyword strings like
"auto" (meant to be Keyword).
Variants§
Fr(f32)
Bare JSON number, e.g. 1 — a flex fraction, same convention as
flex-grow. Equivalent to the string form "1fr".
Keyword(GridTrackKeyword)
"auto" / "min-content" / "max-content".
Length(LengthPercentage)
Any other length/percentage, including the explicit string form of a
flex fraction ("1fr"), which LengthPercentage::parse() resolves
to the same ParsedLength::Fr as the bare-number form above.
Minmax
minmax(min, max)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GridTrack
impl<'de> Deserialize<'de> for GridTrack
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>,
Source§impl JsonSchema for GridTrack
impl JsonSchema for GridTrack
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for GridTrack
Auto Trait Implementations§
impl Freeze for GridTrack
impl RefUnwindSafe for GridTrack
impl Send for GridTrack
impl Sync for GridTrack
impl Unpin for GridTrack
impl UnsafeUnpin for GridTrack
impl UnwindSafe for GridTrack
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more