Enum solang_parser::pt::UserDefinedOperator
source · 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 copy 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
source§fn eq(&self, other: &UserDefinedOperator) -> bool
fn eq(&self, other: &UserDefinedOperator) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for UserDefinedOperator
impl Eq for UserDefinedOperator
impl StructuralEq for UserDefinedOperator
impl StructuralPartialEq for UserDefinedOperator
Auto Trait Implementations§
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