#[non_exhaustive]pub enum MaxSize {
None,
LengthPercentage(NonNegativeLengthPercentage),
Calculation(LengthPercentageCalculation),
MinContent,
MaxContent,
FitContent,
FitContentFunction(NonNegativeLengthPercentageValue),
Stretch,
Contain,
}Expand description
Values supported by the typed maximum-size property APIs.
The stretch, bare fit-content, and contain keywords extend the CSS Sizing Level 3
grammar as defined by CSS Sizing Level 4.
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.
None
The none keyword.
LengthPercentage(NonNegativeLengthPercentage)
A non-negative length or percentage.
Calculation(LengthPercentageCalculation)
A typed length-percentage expression.
MinContent
The min-content keyword.
MaxContent
The max-content keyword.
FitContent
The bare fit-content keyword.
FitContentFunction(NonNegativeLengthPercentageValue)
The fit-content() function with a non-negative argument.
Stretch
The stretch keyword.
Contain
The contain keyword.
Implementations§
Source§impl MaxSize
impl MaxSize
Sourcepub fn fit_content(value: CssDimension) -> Self
pub fn fit_content(value: CssDimension) -> Self
Construct fit-content() with a directly non-negative argument.
Sourcepub fn fit_content_calculated(expression: impl Into<CssDimensionExpr>) -> Self
pub fn fit_content_calculated(expression: impl Into<CssDimensionExpr>) -> Self
Construct fit-content() with a typed calculation.
Trait Implementations§
Source§impl CssWriteTo for MaxSize
impl CssWriteTo for MaxSize
Source§impl From<NonNegativeLengthPercentage> for MaxSize
impl From<NonNegativeLengthPercentage> for MaxSize
Source§fn from(value: NonNegativeLengthPercentage) -> Self
fn from(value: NonNegativeLengthPercentage) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for MaxSize
Auto Trait Implementations§
impl Freeze for MaxSize
impl RefUnwindSafe for MaxSize
impl Send for MaxSize
impl Sync for MaxSize
impl Unpin for MaxSize
impl UnsafeUnpin for MaxSize
impl UnwindSafe for MaxSize
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
impl<T> CheckedCssValue for Twhere
T: CssWriteTo + Sealed,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.