pub enum PercentageContext {
NotAllowed,
Allowed(Optional<NumericBaseType>),
}Expand description
Dictates whether percentages are allowed in the calculation that is parsed using this context, and whether such percentages have a known “percent hint” (the type that they will eventually resolve to). https://drafts.csswg.org/css-values-4/#calc-context
Variants§
NotAllowed
Percentages are not allowed in this calculation context.
Allowed(Optional<NumericBaseType>)
Percentages are allowed with the given pecent hint information.
Implementations§
Source§impl PercentageContext
impl PercentageContext
pub fn not_allowed() -> Self
pub fn allowed() -> Self
pub fn allowed_with_hint(hint: NumericBaseType) -> Self
Trait Implementations§
Source§impl Clone for PercentageContext
impl Clone for PercentageContext
Source§fn clone(&self) -> PercentageContext
fn clone(&self) -> PercentageContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PercentageContext
impl Debug for PercentageContext
Source§impl PartialEq for PercentageContext
impl PartialEq for PercentageContext
Source§fn eq(&self, other: &PercentageContext) -> bool
fn eq(&self, other: &PercentageContext) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PercentageContext
impl StructuralPartialEq for PercentageContext
Auto Trait Implementations§
impl Freeze for PercentageContext
impl RefUnwindSafe for PercentageContext
impl Send for PercentageContext
impl Sync for PercentageContext
impl Unpin for PercentageContext
impl UnsafeUnpin for PercentageContext
impl UnwindSafe for PercentageContext
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