pub struct SassNumber {
pub num: Number,
pub unit: Unit,
pub as_slash: Option<Arc<(Self, Self)>>,
}Fields§
§num: Number§unit: Unit§as_slash: Option<Arc<(Self, Self)>>Implementations§
Source§impl SassNumber
impl SassNumber
pub fn new_unitless<N: Into<Number>>(n: N) -> Self
pub fn has_comparable_units(&self, other_unit: &Unit) -> bool
Sourcepub fn has_compatible_units(&self, other_unit: &Unit) -> bool
pub fn has_compatible_units(&self, other_unit: &Unit) -> bool
Unlike SassNumber::has_comparable_units, this considers Unit::None
to be compatible only with itself
pub fn assert_no_units(&self, name: &str, span: Span) -> SassResult<()>
pub fn assert_unit(&self, unit: &Unit, name: &str, span: Span) -> SassResult<()>
pub fn assert_bounds( &self, name: &str, min: f64, max: f64, span: Span, ) -> SassResult<()>
pub fn assert_int_with_name( &self, name: &'static str, span: Span, ) -> SassResult<i64>
pub fn assert_bounds_with_unit( &self, name: &str, min: f64, max: f64, unit: &Unit, span: Span, ) -> SassResult<()>
pub fn is_comparable_to(&self, other: &Self) -> bool
Sourcepub fn has_possibly_compatible_units(&self, other: &Self) -> bool
pub fn has_possibly_compatible_units(&self, other: &Self) -> bool
For use in calculations
pub fn unit(&self) -> &Unit
Trait Implementations§
Source§impl Add for SassNumber
impl Add for SassNumber
Source§type Output = SassNumber
type Output = SassNumber
The resulting type after applying the
+ operator.Source§impl Clone for SassNumber
impl Clone for SassNumber
Source§fn clone(&self) -> SassNumber
fn clone(&self) -> SassNumber
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SassNumber
impl Debug for SassNumber
Source§impl Div for SassNumber
impl Div for SassNumber
Source§type Output = SassNumber
type Output = SassNumber
The resulting type after applying the
/ operator.Source§impl Mul for SassNumber
impl Mul for SassNumber
Source§type Output = SassNumber
type Output = SassNumber
The resulting type after applying the
* operator.Source§impl PartialEq for SassNumber
impl PartialEq for SassNumber
Source§impl Sub for SassNumber
impl Sub for SassNumber
Source§type Output = SassNumber
type Output = SassNumber
The resulting type after applying the
- operator.impl Eq for SassNumber
Auto Trait Implementations§
impl Freeze for SassNumber
impl RefUnwindSafe for SassNumber
impl Send for SassNumber
impl Sync for SassNumber
impl Unpin for SassNumber
impl UnwindSafe for SassNumber
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.