pub enum UserDefinedOperator {
Show 16 variants
BitwiseAnd,
BitwiseNot,
Negate,
BitwiseOr,
BitwiseXor,
Add,
Divide,
Modulo,
Multiply,
Subtract,
Equal,
More,
MoreEqual,
Less,
LessEqual,
NotEqual,
}Expand description
A user-defined operator.
See also the Solidity blog post on user-defined operators.
Variants§
BitwiseAnd
&
BitwiseNot
~
Negate
-
Note that this is the same as Subtract, and that it is currently not being parsed.
BitwiseOr
|
BitwiseXor
^
Add
+
Divide
/
Modulo
%
Multiply
*
Subtract
-
Equal
==
More
>
MoreEqual
>=
Less
<
LessEqual
<=
NotEqual
!=
Implementations§
Source§impl UserDefinedOperator
impl UserDefinedOperator
Sourcepub const fn args(&self) -> usize
pub const fn args(&self) -> usize
Returns the number of arguments needed for this operator’s operation.
Sourcepub const fn is_bitwise(&self) -> bool
pub const fn is_bitwise(&self) -> bool
Returns whether self is a bitwise operator.
Sourcepub const fn is_arithmetic(&self) -> bool
pub const fn is_arithmetic(&self) -> bool
Returns whether self is an arithmetic operator.
Sourcepub const fn is_comparison(&self) -> bool
pub const fn is_comparison(&self) -> bool
Returns whether this is a comparison operator.
Trait Implementations§
Source§impl Clone for UserDefinedOperator
impl Clone for UserDefinedOperator
Source§fn clone(&self) -> UserDefinedOperator
fn clone(&self) -> UserDefinedOperator
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 UserDefinedOperator
impl Debug for UserDefinedOperator
Source§impl Display for UserDefinedOperator
impl Display for UserDefinedOperator
Source§impl PartialEq for UserDefinedOperator
impl PartialEq for UserDefinedOperator
impl Copy for UserDefinedOperator
impl Eq for UserDefinedOperator
impl StructuralPartialEq for UserDefinedOperator
Auto Trait Implementations§
impl Freeze for UserDefinedOperator
impl RefUnwindSafe for UserDefinedOperator
impl Send for UserDefinedOperator
impl Sync for UserDefinedOperator
impl Unpin for UserDefinedOperator
impl UnwindSafe for UserDefinedOperator
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<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>
Converts
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>
Converts
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