Enum evalexpr::Operator

source ·
pub enum Operator {
Show 32 variants RootNode, Add, Sub, Neg, Mul, Div, Mod, Exp, Eq, Neq, Gt, Lt, Geq, Leq, And, Or, Not, Assign, AddAssign, SubAssign, MulAssign, DivAssign, ModAssign, ExpAssign, AndAssign, OrAssign, Tuple, Chain, Const { value: Value, }, VariableIdentifierWrite { identifier: String, }, VariableIdentifierRead { identifier: String, }, FunctionIdentifier { identifier: String, },
}
Expand description

An enum that represents operators in the operator tree.

Variants§

§

RootNode

A root node in the operator tree. The whole expression is stored under a root node, as well as each subexpression surrounded by parentheses.

§

Add

A binary addition operator.

§

Sub

A binary subtraction operator.

§

Neg

A unary negation operator.

§

Mul

A binary multiplication operator.

§

Div

A binary division operator.

§

Mod

A binary modulo operator.

§

Exp

A binary exponentiation operator.

§

Eq

A binary equality comparator.

§

Neq

A binary inequality comparator.

§

Gt

A binary greater-than comparator.

§

Lt

A binary lower-than comparator.

§

Geq

A binary greater-than-or-equal comparator.

§

Leq

A binary lower-than-or-equal comparator.

§

And

A binary logical and operator.

§

Or

A binary logical or operator.

§

Not

A binary logical not operator.

§

Assign

A binary assignment operator.

§

AddAssign

A binary add-assign operator.

§

SubAssign

A binary subtract-assign operator.

§

MulAssign

A binary multiply-assign operator.

§

DivAssign

A binary divide-assign operator.

§

ModAssign

A binary modulo-assign operator.

§

ExpAssign

A binary exponentiate-assign operator.

§

AndAssign

A binary and-assign operator.

§

OrAssign

A binary or-assign operator.

§

Tuple

An n-ary tuple constructor.

§

Chain

An n-ary subexpression chain.

§

Const

Fields

§value: Value

The value of the constant.

A constant value.

§

VariableIdentifierWrite

Fields

§identifier: String

The identifier of the variable.

A write to a variable identifier.

§

VariableIdentifierRead

Fields

§identifier: String

The identifier of the variable.

A read from a variable identifier.

§

FunctionIdentifier

Fields

§identifier: String

The identifier of the function.

A function identifier.

Trait Implementations§

source§

impl Clone for Operator

source§

fn clone(&self) -> Operator

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Operator

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Operator

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq<Operator> for Operator

source§

fn eq(&self, other: &Operator) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Operator

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.