pub enum Unit {
Zero,
Px(F32),
Em(F32),
Rem(F32),
Vw(F32),
Vh(F32),
Vmin(F32),
Vmax(F32),
Fr(F32),
Percent(F32),
Duration(F32),
Calc(Box<Unit>, Operator, Box<Unit>),
}
Variants§
Zero
Px(F32)
Em(F32)
Rem(F32)
Vw(F32)
Vh(F32)
Vmin(F32)
Vmax(F32)
Fr(F32)
Percent(F32)
Duration(F32)
Calc(Box<Unit>, Operator, Box<Unit>)
Implementations§
source§impl Unit
impl Unit
pub fn calc(left: Self, op: Operator, right: Self) -> Self
pub fn px<T: AsPrimitive<f32>>(x: T) -> Self
pub fn em<T: AsPrimitive<f32>>(x: T) -> Self
pub fn rem<T: AsPrimitive<f32>>(x: T) -> Self
pub fn vw<T: AsPrimitive<f32>>(x: T) -> Self
pub fn vh<T: AsPrimitive<f32>>(x: T) -> Self
pub fn vmin<T: AsPrimitive<f32>>(x: T) -> Self
pub fn vmax<T: AsPrimitive<f32>>(x: T) -> Self
pub fn fr<T: AsPrimitive<f32>>(x: T) -> Self
pub fn pct<T: AsPrimitive<f32>>(x: T) -> Self
pub fn dur<T: AsPrimitive<f32>>(x: T) -> Self
Trait Implementations§
source§impl Ord for Unit
impl Ord for Unit
source§impl PartialEq<Unit> for Unit
impl PartialEq<Unit> for Unit
source§impl PartialOrd<Unit> for Unit
impl PartialOrd<Unit> for Unit
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Unit
impl StructuralEq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
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