Enum rsass::value::Unit[][src]

pub enum Unit {
    Em,
    Ex,
    Ch,
    Rem,
    Vw,
    Vh,
    Vmin,
    Vmax,
    Cm,
    Mm,
    Q,
    In,
    Pt,
    Pc,
    Px,
    Deg,
    Grad,
    Rad,
    Turn,
    S,
    Ms,
    Hz,
    Khz,
    Dpi,
    Dpcm,
    Dppx,
    Percent,
    Fr,
    None,
}

Units in css.

As defined in https://www.w3.org/TR/css3-values/

Variants

Em

em unit, lengths in em-like dimension.

Ex

ex unit, lengths in em-like dimension.

Ch

ch unit, lengths in em-like dimension.

Rem

ch unit, lengths in rem-like dimension.

Vw

vw unit, length relative to viewport width.

Vh

vh unit, length relative to viewport height.

Vmin

vmin unit, length relative to min viewport size.

Vmax

vmax unit, length relative to max viewport size.

Cm

cm unit, absolute length.

Mm

mm unit, absolute length.

Q

q unit, absolute length (4q == 1mm).

In

in unit, absolute length in inch.

Pt

pt unit, absolute length (72pt == 1in).

Pc

pcunit, absolute length (1pc == 12pt, 6pc == 1in).

Px

pxunit, originally pixel size, but does not really mean anything now.

Deg

deg unit, angle in degrees (360 to a turn).

Grad

grad unit, angle in grad (400 to a turn).

Rad

rad unit, angle in degrees (2pi to a turn).

Turn

turn unit, angle in turns.

S

s unit, time in seconds.

Ms

ms unit, time in milliseconds.

Hz

hz unit, frequency in Hz.

Khz

khz unit, frequency in kHz.

Dpi

dpi unit, resolution in dots per inch.

Dpcm

dpcm unit, resolution in dots per cm.

Dppx

dppx unit, resolution in dots per px unit.

Percent

% unit, a percentage of something.

Fr

fr unit, for grid-relative lengths.

None

No unit.

Implementations

impl Unit[src]

pub fn dimension(&self) -> Dimension[src]

Get the dimension of this unit.

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

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

Returns None if the units are of different dimension.

Trait Implementations

impl Clone for Unit[src]

impl Debug for Unit[src]

impl Display for Unit[src]

impl Eq for Unit[src]

impl From<Unit> for UnitSet[src]

impl Ord for Unit[src]

impl PartialEq<Unit> for Unit[src]

impl PartialOrd<Unit> for Unit[src]

impl StructuralEq for Unit[src]

impl StructuralPartialEq for Unit[src]

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

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>,