Struct xpr::Xpr[][src]

pub struct Xpr<T>(_);
Expand description

An expression. Xpr together with the Fold trait are at the heart of this crate.

The nested type is a specific struct representing the operation, e.g. ops::Add.

Xpr instances should be instantiated via the Xpr::new method, which creates Xpr<ops::Term> leaf expressions. The other variants are constructed from them by applying operations to the leaf expressions.

use xpr::*;
let x = Xpr::new(5);
let y = Xpr::new(1);
let z = x * y;
//type of z is xpr::Xpr<xpr::ops::Mul<xpr::Xpr<xpr::ops::Term<{integer}>>, xpr::Xpr<xpr::ops::Term<{integer}>>>>

Implementations

creates a new leaf expression.

evaluates the expression by unwrapping all terminals and applying the operations in the expression. It is synactic sugar for folding the expression with [Evaluator].

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the & operator.

Performs the & operation. Read more

The resulting type after applying the & operator.

Performs the & operation. Read more

The resulting type after applying the | operator.

Performs the | operation. Read more

The resulting type after applying the | operator.

Performs the | operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the << operator.

Performs the << operation. Read more

The resulting type after applying the << operator.

Performs the << operation. Read more

The resulting type after applying the >> operator.

Performs the >> operation. Read more

The resulting type after applying the >> operator.

Performs the >> operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

The output of Fold::fold, Self will replace all instances of T in an expression by values of this type.

perform the replacement

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.