pub enum Operator {
Show 15 variants
And,
Or,
Equal,
EqualSingle,
NotEqual,
Greater,
GreaterE,
Lesser,
LesserE,
Plus,
Minus,
Multiply,
Div,
Modulo,
Not,
}
Expand description
An operator that can be used in a sass value.
Variants§
And
The boolean (value propagating) and
operator.
Or
The boolean (value propagating) or
operator.
Equal
The ==
operator.
EqualSingle
The =
operator. Used insted of Equal in media queries.
NotEqual
The !=
operator.
Greater
The >
operator.
GreaterE
The >=
operator.
Lesser
The <
operator.
LesserE
The <=
operator.
Plus
The +
operator. Also unary positive.
Minus
The -
operator. Also unary negative.
Multiply
The *
operator.
Div
The /
operator.
Modulo
The %
operator.
Not
The unary not
operator.
Implementations§
source§impl Operator
impl Operator
sourcepub fn eval(&self, a: Value, b: Value) -> Result<Option<Value>, BadOp>
pub fn eval(&self, a: Value, b: Value) -> Result<Option<Value>, BadOp>
Evaluate this operator with two operands.
Some operations are known to be invalid, and for those an
error is returned.
Other operations cannot be evaluated but may be valid as is
e.g. in a calc(...)
value. In that case, eval returns
Ok(None).
Trait Implementations§
source§impl Ord for Operator
impl Ord for Operator
source§impl PartialEq for Operator
impl PartialEq for Operator
source§impl PartialOrd for Operator
impl PartialOrd for Operator
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Operator
impl Eq for Operator
impl StructuralEq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnwindSafe for Operator
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