Skip to main content
Version: v1.0.0-beta.0

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

is_minus
pub fn is_minus(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L24-L26

Returns true if this operator is -.

is_not

is_not
pub fn is_not(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L30-L32

true if this operator is !

is_mutable_reference

is_mutable_reference
pub fn is_mutable_reference(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L36-L38

true if this operator is &mut

is_dereference

is_dereference
pub fn is_dereference(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L42-L44

true if this operator is *

quoted

unary_quoted
pub comptime fn quoted(self) -> Quoted {

Source code: noir_stdlib/src/meta/op.nr#L48-L50

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

is_add
pub fn is_add(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L86-L88

true if this operator is +

is_subtract

is_subtract
pub fn is_subtract(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L92-L94

true if this operator is -

is_multiply

is_multiply
pub fn is_multiply(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L98-L100

true if this operator is *

is_divide

is_divide
pub fn is_divide(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L104-L106

true if this operator is /

is_modulo

is_modulo
pub fn is_modulo(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L176-L178

true if this operator is %

is_equal

is_equal
pub fn is_equal(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L110-L112

true if this operator is ==

is_not_equal

is_not_equal
pub fn is_not_equal(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L116-L118

true if this operator is !=

is_less_than

is_less_than
pub fn is_less_than(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L122-L124

true if this operator is <

is_less_than_or_equal

is_less_than_or_equal
pub fn is_less_than_or_equal(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L128-L130

true if this operator is <=

is_greater_than

is_greater_than
pub fn is_greater_than(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L134-L136

true if this operator is >

is_greater_than_or_equal

is_greater_than_or_equal
pub fn is_greater_than_or_equal(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L140-L142

true if this operator is >=

is_and

is_and
pub fn is_and(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L146-L148

true if this operator is &

is_or

is_or
pub fn is_or(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L152-L154

true if this operator is |

is_shift_right

is_shift_right
pub fn is_shift_right(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L164-L166

true if this operator is >>

is_shift_left

is_shift_right
pub fn is_shift_right(self) -> bool {

Source code: noir_stdlib/src/meta/op.nr#L164-L166

true if this operator is <<

quoted

binary_quoted
pub comptime fn quoted(self) -> Quoted {

Source code: noir_stdlib/src/meta/op.nr#L182-L184

Returns this operator as a Quoted value.

Trait Implementations

impl Eq for BinaryOp
impl Hash for BinaryOp