#[repr(C)]pub struct MathClamp {
pub numeric_type: NumericType,
pub values: OwnedArray<NumericValue, 3>,
}Expand description
A clamp expression over numeric values.
This corresponds to CSSMathClamp in the Typed OM specification. A clamp
expression represents constructs such as clamp(10px, 20%, 30px).
The array entries correspond to the lower bound, value, and upper bound, respectively.
Fields§
§numeric_type: NumericTypeThe numeric type associated with this clamp.
values: OwnedArray<NumericValue, 3>The lower bound, value, and upper bound of the clamp expression, in that order.
Implementations§
Source§impl MathClamp
impl MathClamp
Sourcepub fn try_from_numeric_values(
values: OwnedArray<NumericValue, 3>,
) -> Result<Self, ()>
pub fn try_from_numeric_values( values: OwnedArray<NumericValue, 3>, ) -> Result<Self, ()>
Creates a math clamp from a sequence of numeric values.
Returns an error if the values do not have addable numeric types.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MathClamp
impl RefUnwindSafe for MathClamp
impl Send for MathClamp
impl Sync for MathClamp
impl Unpin for MathClamp
impl UnsafeUnpin for MathClamp
impl UnwindSafe for MathClamp
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
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> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert