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 PartialOrd for Operator
impl PartialOrd for Operator
impl Copy for Operator
impl Eq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
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