[−][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: NumValue
plus_sign: bool
lead_zero: bool
Implementations
impl Number
[src]
pub fn as_ratio(&self) -> Result<Ratio<isize>, Error>
[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) -> Option<isize>
[src]
Converts to an integer, rounding towards zero.
An integer that is too big to fit in an isize returns None
.
pub fn format(&self, format: Format) -> Formatted<'_, Self>
[src]
Trait Implementations
impl Add<Number> for Number
[src]
type Output = Number
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl Clone for Number
[src]
impl Debug for Number
[src]
impl<'a> Div<&'a Number> for &'a Number
[src]
type Output = Number
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
impl Div<isize> for Number
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: isize) -> Self
[src]
impl Eq for Number
[src]
impl From<Number> for f64
[src]
impl<T: Into<NumValue>> From<T> for Number
[src]
impl<'_> Mul<&'_ Number> for &'_ Number
[src]
type Output = Number
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl<'_, '_> Mul<&'_ Ratio<isize>> for &'_ Number
[src]
type Output = Number
The resulting type after applying the *
operator.
fn mul(self, rhs: &Ratio<isize>) -> Self::Output
[src]
impl Mul<Ratio<isize>> for Number
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Ratio<isize>) -> Self
[src]
impl Mul<isize> for Number
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: isize) -> Self
[src]
impl<'_> Neg for &'_ Number
[src]
impl PartialEq<Number> for Number
[src]
impl PartialOrd<Number> for Number
[src]
fn partial_cmp(&self, other: &Number) -> Option<Ordering>
[src]
fn lt(&self, other: &Number) -> bool
[src]
fn le(&self, other: &Number) -> bool
[src]
fn gt(&self, other: &Number) -> bool
[src]
fn ge(&self, other: &Number) -> bool
[src]
impl<'_> Rem<&'_ Number> for &'_ Number
[src]
type Output = Number
The resulting type after applying the %
operator.
fn rem(self, rhs: Self) -> Self::Output
[src]
impl StructuralEq for Number
[src]
impl StructuralPartialEq for Number
[src]
impl<'_> Sub<&'_ Number> for &'_ Number
[src]
type Output = Number
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
impl Zero for Number
[src]
Auto Trait Implementations
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnwindSafe for Number
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,
pub fn borrow_mut(&mut self) -> &mut 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,