UnaryOp and BinaryOp
std::meta::op
contains the UnaryOp
and BinaryOp
types as well as methods on them.
These types are used to represent a unary or binary operator respectively in Noir source code.
Types
UnaryOp
Represents a unary operator. One of -
, !
, &mut
, or *
.
Methods
is_minus
pub fn is_minus(self) -> bool {
Returns true
if this operator is -
.
is_not
pub fn is_not(self) -> bool {
true
if this operator is !
is_mutable_reference
pub fn is_mutable_reference(self) -> bool {
true
if this operator is &mut
is_dereference
pub fn is_dereference(self) -> bool {
true
if this operator is *
quoted
pub comptime fn quoted(self) -> Quoted {
Returns this operator as a Quoted
value.
Trait Implementations
impl Eq for UnaryOp
impl Hash for UnaryOp
BinaryOp
Represents a binary operator. One of +
, -
, *
, /
, %
, ==
, !=
, <
, <=
, >
, >=
, &
, |
, ^
, >>
, or <<
.
Methods
is_add
pub fn is_add(self) -> bool {
true
if this operator is +
is_subtract
pub fn is_subtract(self) -> bool {
true
if this operator is -
is_multiply
pub fn is_multiply(self) -> bool {
true
if this operator is *
is_divide
pub fn is_divide(self) -> bool {
true
if this operator is /
is_modulo
pub fn is_modulo(self) -> bool {
true
if this operator is %
is_equal
pub fn is_equal(self) -> bool {
true
if this operator is ==
is_not_equal
pub fn is_not_equal(self) -> bool {
true
if this operator is !=
is_less_than
pub fn is_less_than(self) -> bool {
true
if this operator is <
is_less_than_or_equal
pub fn is_less_than_or_equal(self) -> bool {
true
if this operator is <=
is_greater_than
pub fn is_greater_than(self) -> bool {
true
if this operator is >
is_greater_than_or_equal
pub fn is_greater_than_or_equal(self) -> bool {
true
if this operator is >=
is_and
pub fn is_and(self) -> bool {
true
if this operator is &
is_or
pub fn is_or(self) -> bool {
true
if this operator is |
is_shift_right
pub fn is_shift_right(self) -> bool {
true
if this operator is >>
is_shift_left
pub fn is_shift_right(self) -> bool {
true
if this operator is <<
quoted
pub comptime fn quoted(self) -> Quoted {
Returns this operator as a Quoted
value.
Trait Implementations
impl Eq for BinaryOp
impl Hash for BinaryOp