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 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> 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