[][src]Struct rsass::Number

pub struct Number<N> where
    N: Clone + Integer + Signed
{ pub value: Ratio<N>, pub plus_sign: bool, pub lead_zero: bool, }

The actual number part of a numeric sass or css value.

Only the actual numeric value is included, not any unit, but flags to show a leading plus sign and/or leading zero (for values between -1 and 1) is included.

Fields

value: Ratio<N>plus_sign: boollead_zero: bool

Implementations

impl<N> Number<N> where
    N: Clone + Integer + Signed
[src]

pub fn abs(self) -> Self[src]

Computes the absolute value of the number, retaining the flags.

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

Returns true if the number is an integer.

pub fn to_integer(&self) -> N[src]

Converts to an integer, rounding towards zero.

pub fn format(&self, format: Format) -> Formatted<'_, Self>[src]

Trait Implementations

impl<N> Add<Number<N>> for Number<N> where
    N: Clone + Integer + Signed
[src]

type Output = Number<N>

The resulting type after applying the + operator.

impl<N: Clone> Clone for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<N: Debug> Debug for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<'a, N> Div<&'a Number<N>> for &'a Number<N> where
    N: Clone + Integer + Signed
[src]

type Output = Number<N>

The resulting type after applying the / operator.

impl<N: Eq> Eq for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<N, T> From<T> for Number<N> where
    T: Into<Ratio<N>>,
    N: Clone + Integer + Signed
[src]

impl<'a, N> Mul<&'a Number<N>> for &'a Number<N> where
    N: Clone + Integer + Signed
[src]

type Output = Number<N>

The resulting type after applying the * operator.

impl<'a, N> Neg for &'a Number<N> where
    N: Clone + Integer + Signed
[src]

type Output = Number<N>

The resulting type after applying the - operator.

impl<N: Ord> Ord for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<N: PartialEq> PartialEq<Number<N>> for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<N: PartialOrd> PartialOrd<Number<N>> for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<'a, N> Rem<&'a Number<N>> for &'a Number<N> where
    N: Clone + Integer + Signed
[src]

type Output = Number<N>

The resulting type after applying the % operator.

impl<N> StructuralEq for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<N> StructuralPartialEq for Number<N> where
    N: Clone + Integer + Signed
[src]

impl<'a, N> Sub<&'a Number<N>> for &'a Number<N> where
    N: Clone + Integer + Signed
[src]

type Output = Number<N>

The resulting type after applying the - operator.

impl Zero for Number<isize>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Number<N> where
    N: RefUnwindSafe

impl<N> Send for Number<N> where
    N: Send

impl<N> Sync for Number<N> where
    N: Sync

impl<N> Unpin for Number<N> where
    N: Unpin

impl<N> UnwindSafe for Number<N> where
    N: UnwindSafe

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> From<!> for T[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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