Struct rsass::value::UnitSet[][src]

pub struct UnitSet { /* fields omitted */ }

A set of units.

Eg. 10em * 10em is an area of 100em². Css does not support such arbitrary units, but sass does, and if you divide it by a length you get a valid css length.

Implementations

impl UnitSet[src]

pub fn scalar() -> Self[src]

An empty UnitSet for a scalar value.

pub fn is_none(&self) -> bool[src]

Check if this UnitSet is empty.

pub fn is_percent(&self) -> bool[src]

Check if this UnitSet is the percent unit.

pub fn is_compatible(&self, other: &Self) -> bool[src]

Check if this UnitSet is compatible with another UnitSet.

pub fn scale_to(&self, other: &UnitSet) -> Option<Number>[src]

Get a scaling factor to convert this unit to another unit.

Returns None if the units are of different dimension.

pub fn scale_to_unit(&self, other: &Unit) -> Option<Number>[src]

Get a scaling factor to convert this unit to another unit.

Returns None if the units are of different dimension.

pub fn simplify(&mut self) -> Number[src]

Simplify this unit set, returning a scaling factor.

Trait Implementations

impl Clone for UnitSet[src]

impl Debug for UnitSet[src]

impl Display for UnitSet[src]

impl Div<&'_ UnitSet> for &UnitSet[src]

type Output = UnitSet

The resulting type after applying the / operator.

impl Eq for UnitSet[src]

impl From<Unit> for UnitSet[src]

impl Mul<&'_ UnitSet> for &UnitSet[src]

type Output = UnitSet

The resulting type after applying the * operator.

impl PartialEq<UnitSet> for UnitSet[src]

impl StructuralEq for UnitSet[src]

impl StructuralPartialEq for UnitSet[src]

Auto Trait Implementations

impl RefUnwindSafe for UnitSet

impl Send for UnitSet

impl Sync for UnitSet

impl Unpin for UnitSet

impl UnwindSafe for UnitSet

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,