pub struct LengthPercentageCalculation(/* private fields */);Expand description
A length-percentage math expression suitable for a property grammar.
This wrapper guarantees that a simple operand is emitted inside calc(). That distinction
matters for range-restricted grammars: calc(-1px) is valid and is clamped by
CSS math-function range checking, while a plain -1px can be invalid for the same property.
Implementations§
Source§impl LengthPercentageCalculation
impl LengthPercentageCalculation
Sourcepub fn new(expression: impl Into<CssDimensionExpr>) -> Self
pub fn new(expression: impl Into<CssDimensionExpr>) -> Self
Construct a checked length-percentage calculation.
Trait Implementations§
Source§impl Clone for LengthPercentageCalculation
impl Clone for LengthPercentageCalculation
Source§impl Debug for LengthPercentageCalculation
impl Debug for LengthPercentageCalculation
Source§impl From<LengthPercentageCalculation> for NonNegativeLengthPercentageValue
impl From<LengthPercentageCalculation> for NonNegativeLengthPercentageValue
Source§fn from(value: LengthPercentageCalculation) -> Self
fn from(value: LengthPercentageCalculation) -> Self
Converts to this type from the input type.
Source§impl From<LengthPercentageCalculation> for DeclarationValue<NonNegativeLengthPercentageValue>
impl From<LengthPercentageCalculation> for DeclarationValue<NonNegativeLengthPercentageValue>
Source§fn from(value: LengthPercentageCalculation) -> Self
fn from(value: LengthPercentageCalculation) -> Self
Converts to this type from the input type.
Source§impl From<LengthPercentageCalculation> for GapValue
impl From<LengthPercentageCalculation> for GapValue
Source§fn from(value: LengthPercentageCalculation) -> Self
fn from(value: LengthPercentageCalculation) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for LengthPercentageCalculation
Auto Trait Implementations§
impl Freeze for LengthPercentageCalculation
impl RefUnwindSafe for LengthPercentageCalculation
impl Send for LengthPercentageCalculation
impl Sync for LengthPercentageCalculation
impl Unpin for LengthPercentageCalculation
impl UnsafeUnpin for LengthPercentageCalculation
impl UnwindSafe for LengthPercentageCalculation
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.