pub enum BinOpKind {
Show 19 variants
Add,
Sub,
Mul,
Div,
Mod,
Pow,
BitAnd,
BitOr,
BitXor,
Shl,
Shr,
Eq,
Ne,
Lt,
Gt,
Le,
Ge,
And,
Or,
}Expand description
Binary arithmetic operator kind.
Variants§
Add
+ — desugars to u64_add or f64_add based on operand types
Sub
- — desugars to u64_sub or f64_sub based on operand types
Mul
* — desugars to u64_mul or f64_mul based on operand types
Div
/ — desugars to u64_div or f64_div based on operand types
Mod
% — desugars to u64_mod or f64_mod based on operand types
Pow
** — desugars to pow(a, b) (always f64)
BitAnd
& — desugars to u64_and(a, b)
BitOr
| — desugars to u64_or(a, b)
BitXor
^ — desugars to u64_xor(a, b)
Shl
<< — desugars to u64_shl(a, b)
Shr
>> — desugars to u64_shr(a, b)
Eq
== — desugars to u64_eq / f64_eq. Output type is u64
(0 = false, 1 = true).
Ne
!= — desugars to u64_ne / f64_ne. Output type is u64.
Lt
< — desugars to u64_lt / f64_lt. Output type is u64.
Gt
> — desugars to u64_gt / f64_gt. Output type is u64.
Le
<= — desugars to u64_le / f64_le. Output type is u64.
Ge
>= — desugars to u64_ge / f64_ge. Output type is u64.
And
&& — eager logical-and (SRD-84 Part 1). Desugars to
u64_and(a != 0, b != 0): both operands evaluate, each is
normalised to truthiness (0/1), and the bitwise-and of two
truthiness values is logical-and. Output type is u64 (0/1).
Lowest precedence, below comparison. Short-circuit is a deferred
optimisation (SRD-84 §“eager”).
Or
|| — eager logical-or (SRD-84 Part 1). Desugars to
u64_or(a != 0, b != 0). Output type is u64 (0/1). Binds
looser than &&.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BinOpKind
impl RefUnwindSafe for BinOpKind
impl Send for BinOpKind
impl Sync for BinOpKind
impl Unpin for BinOpKind
impl UnsafeUnpin for BinOpKind
impl UnwindSafe for BinOpKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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