[−][src]Struct rsass::Number
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: bool
lead_zero: bool
Implementations
impl<N> Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
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]
N: Clone + Integer + Signed,
type Output = Number<N>
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl<N: Clone> Clone for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
impl<N: Debug> Debug for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
impl<'a, N> Div<&'a Number<N>> for &'a Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
type Output = Number<N>
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
impl<N: Eq> Eq for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
impl<N, T> From<T> for Number<N> where
T: Into<Ratio<N>>,
N: Clone + Integer + Signed,
[src]
T: Into<Ratio<N>>,
N: Clone + Integer + Signed,
impl<'a, N> Mul<&'a Number<N>> for &'a Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
type Output = Number<N>
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl<'a, N> Neg for &'a Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
type Output = Number<N>
The resulting type after applying the -
operator.
fn neg(self) -> Number<N>
[src]
impl<N: Ord> Ord for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
fn cmp(&self, other: &Number<N>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<N: PartialEq> PartialEq<Number<N>> for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
impl<N: PartialOrd> PartialOrd<Number<N>> for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
fn partial_cmp(&self, other: &Number<N>) -> Option<Ordering>
[src]
fn lt(&self, other: &Number<N>) -> bool
[src]
fn le(&self, other: &Number<N>) -> bool
[src]
fn gt(&self, other: &Number<N>) -> bool
[src]
fn ge(&self, other: &Number<N>) -> bool
[src]
impl<'a, N> Rem<&'a Number<N>> for &'a Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
type Output = Number<N>
The resulting type after applying the %
operator.
fn rem(self, rhs: Self) -> Self::Output
[src]
impl<N> StructuralEq for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
impl<N> StructuralPartialEq for Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
impl<'a, N> Sub<&'a Number<N>> for &'a Number<N> where
N: Clone + Integer + Signed,
[src]
N: Clone + Integer + Signed,
type Output = Number<N>
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
impl Zero for Number<isize>
[src]
Auto Trait Implementations
impl<N> RefUnwindSafe for Number<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Number<N> where
N: Send,
N: Send,
impl<N> Sync for Number<N> where
N: Sync,
N: Sync,
impl<N> Unpin for Number<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for Number<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,