pub enum BinaryOperation {
Show 30 variants
Add,
AddWrapped,
And,
BitwiseAnd,
Div,
DivWrapped,
Eq,
Gte,
Gt,
Lte,
Lt,
Mod,
Mul,
MulWrapped,
Nand,
Neq,
Nor,
Or,
BitwiseOr,
Pow,
PowWrapped,
Rem,
RemWrapped,
Shl,
ShlWrapped,
Shr,
ShrWrapped,
Sub,
SubWrapped,
Xor,
}
Expand description
A binary operator.
Precedence is defined in the parser.
Variants§
Add
Addition, i.e. +
, .add()
.
AddWrapped
Wrapping addition, i.e. .add_wrapped()
.
And
Logical AND, i.e. &&
.
BitwiseAnd
Bitwise AND, i.e. &
, .and()
.
Div
Division, i.e. /
, .div()
.
DivWrapped
Wrapping division, i.e. .div_wrapped()
.
Eq
Equality relation, i.e. ==
, .eq()
.
Gte
Greater-or-equal relation, i.e. >=
, .gte()
.
Gt
Greater-than relation, i.e. >
, .gt()
.
Lte
Lesser-or-equal relation, i.e. <=
, .lte()
.
Lt
Lesser-than relation, i.e. <
, .lt()
.
Mod
Arithmetic modulo, i.e. .mod()
Mul
Multiplication, i.e. *
, .mul()
.
MulWrapped
Wrapping multiplication, i.e. .mul_wrapped()
.
Nand
Boolean NAND, i.e. .nand()
.
Neq
In-equality relation, i.e. !=
, .neq()
.
Nor
Boolean NOR, i.e. .nor()
.
Or
Logical OR, i.e. ||
.
BitwiseOr
Bitwise OR, i.e. |
, .or()
.
Pow
Exponentiation, i.e. **
in a ** b
, .pow()
.
PowWrapped
Wrapping exponentiation, i.e. .pow_wrapped()
.
Rem
Remainder, i.e. %
, .rem()
.
RemWrapped
Wrapping remainder, i.e. .rem_wrapped()
.
Shl
Shift left operation, i.e. <<
, .shl()
.
ShlWrapped
Wrapping shift left operation, i.e. .shl_wrapped()
.
Shr
Shift right operation, i.e. >>, .shr()
.
ShrWrapped
Wrapping shift right operation, i.e. .shr_wrapped()
.
Sub
Subtraction, i.e. -
, .sub()
.
SubWrapped
Wrapped subtraction, i.e. .sub_wrapped()
.
Xor
Bitwise XOR, i.e. .xor()
.
Implementations§
Source§impl BinaryOperation
impl BinaryOperation
Sourcepub fn from_symbol(symbol: Symbol) -> Option<Self>
pub fn from_symbol(symbol: Symbol) -> Option<Self>
Returns a BinaryOperation
from the given Symbol
.
This is used to resolve native operators invoked as method calls, e.g. a.add_wrapped(b)
.
Trait Implementations§
Source§impl Clone for BinaryOperation
impl Clone for BinaryOperation
Source§fn clone(&self) -> BinaryOperation
fn clone(&self) -> BinaryOperation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BinaryOperation
impl Debug for BinaryOperation
Source§impl<'de> Deserialize<'de> for BinaryOperation
impl<'de> Deserialize<'de> for BinaryOperation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for BinaryOperation
impl Display for BinaryOperation
Source§impl PartialEq for BinaryOperation
impl PartialEq for BinaryOperation
Source§impl Serialize for BinaryOperation
impl Serialize for BinaryOperation
impl Copy for BinaryOperation
impl Eq for BinaryOperation
impl StructuralPartialEq for BinaryOperation
Auto Trait Implementations§
impl Freeze for BinaryOperation
impl RefUnwindSafe for BinaryOperation
impl Send for BinaryOperation
impl Sync for BinaryOperation
impl Unpin for BinaryOperation
impl UnwindSafe for BinaryOperation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more