Skip to main content

Expr

Enum Expr 

Source
pub enum Expr {
Show 149 variants Constant(f64), BigInt(BigInt), Rational(BigRational), Boolean(bool), Variable(String), Pattern(String), Add(Arc<Self>, Arc<Self>), Sub(Arc<Self>, Arc<Self>), Mul(Arc<Self>, Arc<Self>), Div(Arc<Self>, Arc<Self>), Power(Arc<Self>, Arc<Self>), Neg(Arc<Self>), AddList(Vec<Self>), MulList(Vec<Self>), Sin(Arc<Self>), Cos(Arc<Self>), Tan(Arc<Self>), Exp(Arc<Self>), Log(Arc<Self>), Abs(Arc<Self>), Sqrt(Arc<Self>), Eq(Arc<Self>, Arc<Self>), Lt(Arc<Self>, Arc<Self>), Gt(Arc<Self>, Arc<Self>), Le(Arc<Self>, Arc<Self>), Ge(Arc<Self>, Arc<Self>), Matrix(Vec<Vec<Self>>), Vector(Vec<Self>), Complex(Arc<Self>, Arc<Self>), Transpose(Arc<Self>), MatrixMul(Arc<Self>, Arc<Self>), MatrixVecMul(Arc<Self>, Arc<Self>), Inverse(Arc<Self>), Derivative(Arc<Self>, String), DerivativeN(Arc<Self>, String, Arc<Self>), Integral { integrand: Arc<Self>, var: Arc<Self>, lower_bound: Arc<Self>, upper_bound: Arc<Self>, }, VolumeIntegral { scalar_field: Arc<Self>, volume: Arc<Self>, }, SurfaceIntegral { vector_field: Arc<Self>, surface: Arc<Self>, }, Limit(Arc<Self>, String, Arc<Self>), Sum { body: Arc<Self>, var: Arc<Self>, from: Arc<Self>, to: Arc<Self>, }, Series(Arc<Self>, String, Arc<Self>, Arc<Self>), Summation(Arc<Self>, String, Arc<Self>, Arc<Self>), Product(Arc<Self>, String, Arc<Self>, Arc<Self>), ConvergenceAnalysis(Arc<Self>, String), AsymptoticExpansion(Arc<Self>, String, Arc<Self>, Arc<Self>), IndefiniteSum { body: Arc<Self>, var: String, step: Arc<Self>, }, IndefiniteProduct { body: Arc<Self>, var: String, step: Arc<Self>, }, Sec(Arc<Self>), Csc(Arc<Self>), Cot(Arc<Self>), ArcSin(Arc<Self>), ArcCos(Arc<Self>), ArcTan(Arc<Self>), ArcSec(Arc<Self>), ArcCsc(Arc<Self>), ArcCot(Arc<Self>), Sinh(Arc<Self>), Cosh(Arc<Self>), Tanh(Arc<Self>), Sech(Arc<Self>), Csch(Arc<Self>), Coth(Arc<Self>), ArcSinh(Arc<Self>), ArcCosh(Arc<Self>), ArcTanh(Arc<Self>), ArcSech(Arc<Self>), ArcCsch(Arc<Self>), ArcCoth(Arc<Self>), LogBase(Arc<Self>, Arc<Self>), Atan2(Arc<Self>, Arc<Self>), Binomial(Arc<Self>, Arc<Self>), Factorial(Arc<Self>), Permutation(Arc<Self>, Arc<Self>), Combination(Arc<Self>, Arc<Self>), FallingFactorial(Arc<Self>, Arc<Self>), RisingFactorial(Arc<Self>, Arc<Self>), Path(PathType, Arc<Self>, Arc<Self>), Boundary(Arc<Self>), Domain(String), Pi, E, Infinity, NegativeInfinity, Gamma(Arc<Self>), Beta(Arc<Self>, Arc<Self>), Erf(Arc<Self>), Erfc(Arc<Self>), Erfi(Arc<Self>), Zeta(Arc<Self>), BesselJ(Arc<Self>, Arc<Self>), BesselY(Arc<Self>, Arc<Self>), LegendreP(Arc<Self>, Arc<Self>), LaguerreL(Arc<Self>, Arc<Self>), HermiteH(Arc<Self>, Arc<Self>), Digamma(Arc<Self>), KroneckerDelta(Arc<Self>, Arc<Self>), And(Vec<Self>), Or(Vec<Self>), Not(Arc<Self>), Xor(Arc<Self>, Arc<Self>), Implies(Arc<Self>, Arc<Self>), Equivalent(Arc<Self>, Arc<Self>), Predicate { name: String, args: Vec<Self>, }, ForAll(String, Arc<Self>), Exists(String, Arc<Self>), Union(Vec<Self>), Interval(Arc<Self>, Arc<Self>, bool, bool), Polynomial(Vec<Self>), SparsePolynomial(SparsePolynomial), Floor(Arc<Self>), IsPrime(Arc<Self>), Gcd(Arc<Self>, Arc<Self>), Mod(Arc<Self>, Arc<Self>), Solve(Arc<Self>, String), Substitute(Arc<Self>, String, Arc<Self>), System(Vec<Self>), Solutions(Vec<Self>), ParametricSolution { x: Arc<Self>, y: Arc<Self>, }, RootOf { poly: Arc<Self>, index: u32, }, InfiniteSolutions, NoSolution, Ode { equation: Arc<Self>, func: String, var: String, }, Pde { equation: Arc<Self>, func: String, vars: Vec<String>, }, GeneralSolution(Arc<Self>), ParticularSolution(Arc<Self>), Fredholm(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>), Volterra(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>), Apply(Arc<Self>, Arc<Self>), Tuple(Vec<Self>), Dag(Arc<DagNode>), Distribution(Arc<dyn Distribution>), Max(Arc<Self>, Arc<Self>), Quantity(Arc<UnitQuantity>), QuantityWithValue(Arc<Self>, String), CustomZero, CustomString(String), CustomArcOne(Arc<Self>), CustomArcTwo(Arc<Self>, Arc<Self>), CustomArcThree(Arc<Self>, Arc<Self>, Arc<Self>), CustomArcFour(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>), CustomArcFive(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>), CustomVecOne(Vec<Self>), CustomVecTwo(Vec<Self>, Vec<Self>), CustomVecThree(Vec<Self>, Vec<Self>, Vec<Self>), CustomVecFour(Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>), CustomVecFive(Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>), UnaryList(String, Arc<Self>), BinaryList(String, Arc<Self>, Arc<Self>), NaryList(String, Vec<Self>),
}
Expand description

The central enum representing a mathematical expression in the symbolic system.

Expr is an Abstract Syntax Tree (AST) that can represent a wide variety of mathematical objects and operations. Manual implementations for Debug, Clone, PartialEq, Eq, and Hash are provided to handle variants containing types that do not derive these traits automatically (e.g., f64, Arc<dyn Distribution>).

Variants§

§

Constant(f64)

A floating-point constant (64-bit).

§

BigInt(BigInt)

An arbitrary-precision integer.

§

Rational(BigRational)

An arbitrary-precision rational number.

§

Boolean(bool)

A boolean value (true or false).

§

Variable(String)

A symbolic variable, represented by a string name.

§

Pattern(String)

A pattern variable, used for rule-matching systems.

§

Add(Arc<Self>, Arc<Self>)

Addition of two expressions.

§

Sub(Arc<Self>, Arc<Self>)

Subtraction of two expressions.

§

Mul(Arc<Self>, Arc<Self>)

Multiplication of two expressions.

§

Div(Arc<Self>, Arc<Self>)

Division of two expressions.

§

Power(Arc<Self>, Arc<Self>)

Exponentiation (base raised to the power of exponent).

§

Neg(Arc<Self>)

Negation of an expression.

§

AddList(Vec<Self>)

N-ary Addition (Sum of a list of expressions).

This variant represents the sum of multiple expressions in a single operation, which is more efficient than nested binary Add operations for associative operations. It’s part of the AST to DAG migration strategy, allowing for more flexible expression representation without breaking existing code.

§Examples

use rssn::symbolic::core::Expr;

// Representing a + b + c + d as a single n-ary operation
let sum = Expr::AddList(vec![
    Expr::Variable("a".to_string()),
    Expr::Variable("b".to_string()),
    Expr::Variable("c".to_string()),
    Expr::Variable("d".to_string()),
]);
§

MulList(Vec<Self>)

N-ary Multiplication (Product of a list of expressions).

This variant represents the product of multiple expressions in a single operation, which is more efficient than nested binary Mul operations for associative operations. It’s part of the AST to DAG migration strategy, allowing for more flexible expression representation without breaking existing code.

§Examples

use rssn::symbolic::core::Expr;

// Representing a * b * c * d as a single n-ary operation
let product = Expr::MulList(vec![
    Expr::Variable("a".to_string()),
    Expr::Variable("b".to_string()),
    Expr::Variable("c".to_string()),
    Expr::Variable("d".to_string()),
]);
§

Sin(Arc<Self>)

The sine function.

§

Cos(Arc<Self>)

The cosine function.

§

Tan(Arc<Self>)

The tangent function.

§

Exp(Arc<Self>)

The natural exponential function, e^x.

§

Log(Arc<Self>)

The natural logarithm, ln(x).

§

Abs(Arc<Self>)

The absolute value function, |x|.

§

Sqrt(Arc<Self>)

The square root function.

§

Eq(Arc<Self>, Arc<Self>)

Represents an equation (left = right).

§

Lt(Arc<Self>, Arc<Self>)

Less than (<).

§

Gt(Arc<Self>, Arc<Self>)

Greater than (>).

§

Le(Arc<Self>, Arc<Self>)

Less than or equal to (<=).

§

Ge(Arc<Self>, Arc<Self>)

Greater than or equal to (>=).

§

Matrix(Vec<Vec<Self>>)

A matrix, represented as a vector of row vectors.

§

Vector(Vec<Self>)

A vector (or column matrix).

§

Complex(Arc<Self>, Arc<Self>)

A complex number with real and imaginary parts.

§

Transpose(Arc<Self>)

Matrix transpose.

§

MatrixMul(Arc<Self>, Arc<Self>)

Matrix-matrix multiplication.

§

MatrixVecMul(Arc<Self>, Arc<Self>)

Matrix-vector multiplication.

§

Inverse(Arc<Self>)

Matrix inverse.

§

Derivative(Arc<Self>, String)

The derivative of an expression with respect to a variable.

§

DerivativeN(Arc<Self>, String, Arc<Self>)

The N-th derivative of an expression.

§

Integral

A definite integral of integrand with respect to var from lower_bound to upper_bound.

Fields

§integrand: Arc<Self>

The expression to be integrated.

§var: Arc<Self>

The variable of integration.

§lower_bound: Arc<Self>

The lower limit of integration.

§upper_bound: Arc<Self>

The upper limit of integration.

§

VolumeIntegral

A volume integral of a scalar field over a specified volume.

Fields

§scalar_field: Arc<Self>

The scalar field to be integrated over the volume.

§volume: Arc<Self>

The volume domain.

§

SurfaceIntegral

A surface integral of a vector field over a specified surface.

Fields

§vector_field: Arc<Self>

The vector field to be integrated over the surface.

§surface: Arc<Self>

The surface domain.

§

Limit(Arc<Self>, String, Arc<Self>)

A limit of an expression as a variable approaches a point.

§

Sum

A summation of body with var from from to to.

Fields

§body: Arc<Self>

The expression to be summed.

§var: Arc<Self>

The summation variable.

§from: Arc<Self>

The starting value of the summation variable.

§to: Arc<Self>

The ending value of the summation variable.

§

Series(Arc<Self>, String, Arc<Self>, Arc<Self>)

A finite or infinite series expansion.

§

Summation(Arc<Self>, String, Arc<Self>, Arc<Self>)

A summation over a range (similar to Sum).

§

Product(Arc<Self>, String, Arc<Self>, Arc<Self>)

A product of terms over a range.

§

ConvergenceAnalysis(Arc<Self>, String)

Represents a convergence analysis for a series.

§

AsymptoticExpansion(Arc<Self>, String, Arc<Self>, Arc<Self>)

An asymptotic expansion of a function.

§

IndefiniteSum

An indefinite sum (anti-difference) of body with variable var and step size step.

Fields

§body: Arc<Self>

The expression to be summed.

§var: String

The summation variable.

§step: Arc<Self>

The step size.

§

IndefiniteProduct

An indefinite product of body with variable var and step size step.

Fields

§body: Arc<Self>

The expression to be multiplied.

§var: String

The product variable.

§step: Arc<Self>

The step size.

§

Sec(Arc<Self>)

Secant function.

§

Csc(Arc<Self>)

Cosecant function.

§

Cot(Arc<Self>)

Cotangent function.

§

ArcSin(Arc<Self>)

Arcsine (inverse sine).

§

ArcCos(Arc<Self>)

Arccosine (inverse cosine).

§

ArcTan(Arc<Self>)

Arctangent (inverse tangent).

§

ArcSec(Arc<Self>)

Arcsecant (inverse secant).

§

ArcCsc(Arc<Self>)

Arccosecant (inverse cosecant).

§

ArcCot(Arc<Self>)

Arccotangent (inverse cotangent).

§

Sinh(Arc<Self>)

Hyperbolic sine.

§

Cosh(Arc<Self>)

Hyperbolic cosine.

§

Tanh(Arc<Self>)

Hyperbolic tangent.

§

Sech(Arc<Self>)

Hyperbolic secant.

§

Csch(Arc<Self>)

Hyperbolic cosecant.

§

Coth(Arc<Self>)

Hyperbolic cotangent.

§

ArcSinh(Arc<Self>)

Inverse hyperbolic sine.

§

ArcCosh(Arc<Self>)

Inverse hyperbolic cosine.

§

ArcTanh(Arc<Self>)

Inverse hyperbolic tangent.

§

ArcSech(Arc<Self>)

Inverse hyperbolic secant.

§

ArcCsch(Arc<Self>)

Inverse hyperbolic cosecant.

§

ArcCoth(Arc<Self>)

Inverse hyperbolic cotangent.

§

LogBase(Arc<Self>, Arc<Self>)

Logarithm with a specified base.

§

Atan2(Arc<Self>, Arc<Self>)

Two-argument arctangent.

§

Binomial(Arc<Self>, Arc<Self>)

Binomial coefficient, “n choose k”.

§

Factorial(Arc<Self>)

Factorial, n!.

§

Permutation(Arc<Self>, Arc<Self>)

Permutations, P(n, k).

§

Combination(Arc<Self>, Arc<Self>)

Combinations, C(n, k).

§

FallingFactorial(Arc<Self>, Arc<Self>)

Falling factorial.

§

RisingFactorial(Arc<Self>, Arc<Self>)

Rising factorial.

§

Path(PathType, Arc<Self>, Arc<Self>)

A path for path integrals (e.g., line, circle).

§

Boundary(Arc<Self>)

Represents the boundary of a domain.

§

Domain(String)

Represents a named domain (e.g., for integrals).

§

Pi

The mathematical constant Pi (π).

§

E

The mathematical constant E (e, Euler’s number).

§

Infinity

Represents infinity.

§

NegativeInfinity

Represents negative infinity.

§

Gamma(Arc<Self>)

The Gamma function.

§

Beta(Arc<Self>, Arc<Self>)

The Beta function.

§

Erf(Arc<Self>)

The error function.

§

Erfc(Arc<Self>)

The complementary error function.

§

Erfi(Arc<Self>)

The imaginary error function.

§

Zeta(Arc<Self>)

The Riemann Zeta function.

§

BesselJ(Arc<Self>, Arc<Self>)

Bessel function of the first kind.

§

BesselY(Arc<Self>, Arc<Self>)

Bessel function of the second kind.

§

LegendreP(Arc<Self>, Arc<Self>)

Legendre polynomial.

§

LaguerreL(Arc<Self>, Arc<Self>)

Laguerre polynomial.

§

HermiteH(Arc<Self>, Arc<Self>)

Hermite polynomial.

§

Digamma(Arc<Self>)

The digamma function (psi function).

§

KroneckerDelta(Arc<Self>, Arc<Self>)

The Kronecker delta function.

§

And(Vec<Self>)

Logical AND of a vector of expressions.

§

Or(Vec<Self>)

Logical OR of a vector of expressions.

§

Not(Arc<Self>)

Logical NOT.

§

Xor(Arc<Self>, Arc<Self>)

Logical XOR (exclusive OR).

§

Implies(Arc<Self>, Arc<Self>)

Logical implication (A => B).

§

Equivalent(Arc<Self>, Arc<Self>)

Logical equivalence (A <=> B).

§

Predicate

A predicate with a name and arguments.

Fields

§name: String

The name of the predicate.

§args: Vec<Self>

The arguments to the predicate.

§

ForAll(String, Arc<Self>)

Universal quantifier (“for all”).

§

Exists(String, Arc<Self>)

Existential quantifier (“there exists”).

§

Union(Vec<Self>)

A union of sets or intervals.

§

Interval(Arc<Self>, Arc<Self>, bool, bool)

An interval with a lower and upper bound, and flags for inclusion.

§

Polynomial(Vec<Self>)

A dense polynomial represented by its coefficients.

§

SparsePolynomial(SparsePolynomial)

A sparse polynomial.

§

Floor(Arc<Self>)

The floor function.

§

IsPrime(Arc<Self>)

A predicate to check if a number is prime.

§

Gcd(Arc<Self>, Arc<Self>)

Greatest Common Divisor (GCD).

§

Mod(Arc<Self>, Arc<Self>)

Modulo operation.

§

Solve(Arc<Self>, String)

Represents the action of solving an equation for a variable.

§

Substitute(Arc<Self>, String, Arc<Self>)

Represents the substitution of a variable in an expression with another expression.

§

System(Vec<Self>)

Represents a system of equations to be solved.

§

Solutions(Vec<Self>)

Represents the set of solutions to an equation or system.

§

ParametricSolution

A parametric solution, e.g., for a system of ODEs.

Fields

§x: Arc<Self>

The x-component of the parametric solution.

§y: Arc<Self>

The y-component of the parametric solution.

§

RootOf

Represents the i-th root of a polynomial.

Fields

§poly: Arc<Self>

The polynomial to find the root of.

§index: u32

The index of the root (for polynomials with multiple roots).

§

InfiniteSolutions

Represents infinite solutions.

§

NoSolution

Represents that no solution exists.

§

Ode

An ordinary differential equation (ODE).

Fields

§equation: Arc<Self>

The differential equation.

§func: String

The unknown function name.

§var: String

The independent variable name.

§

Pde

A partial differential equation (PDE).

Fields

§equation: Arc<Self>

The partial differential equation.

§func: String

The unknown function name.

§vars: Vec<String>

The independent variable names.

§

GeneralSolution(Arc<Self>)

The general solution to a differential equation.

§

ParticularSolution(Arc<Self>)

A particular solution to a differential equation.

§

Fredholm(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>)

A Fredholm integral equation.

§

Volterra(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>)

A Volterra integral equation.

§

Apply(Arc<Self>, Arc<Self>)

Application of a function to an argument.

§

Tuple(Vec<Self>)

A tuple of expressions.

§

Dag(Arc<DagNode>)

A node in a Directed Acyclic Graph (DAG) for expression sharing.

This is now the preferred representation for all expressions. When serialized, the DAG structure is preserved.

§

Distribution(Arc<dyn Distribution>)

A probability distribution.

§

Max(Arc<Self>, Arc<Self>)

Maximum of two expressions.

§

Quantity(Arc<UnitQuantity>)

A unified quantity with its value and unit string.

§

QuantityWithValue(Arc<Self>, String)

A temporary representation of a value with a unit string, before unification.

§

CustomZero

👎Deprecated since 0.1.18:

Please use the ‘UnaryList’ variant instead.

Deprecated: Zero-argument custom operation.

§

CustomString(String)

👎Deprecated since 0.1.18:

Please use the ‘UnaryList’ variant instead.

Deprecated: String-argument custom operation.

§

CustomArcOne(Arc<Self>)

👎Deprecated since 0.1.18:

Please use the ‘UnaryList’ variant instead.

Deprecated: One-arc-argument custom operation.

§

CustomArcTwo(Arc<Self>, Arc<Self>)

👎Deprecated since 0.1.18:

Please use the ‘BinaryList’ variant instead.

Deprecated: Two-arc-argument custom operation.

§

CustomArcThree(Arc<Self>, Arc<Self>, Arc<Self>)

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Deprecated: Three-arc-argument custom operation.

§

CustomArcFour(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>)

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Deprecated: Four-arc-argument custom operation.

§

CustomArcFive(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>)

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Deprecated: Five-arc-argument custom operation.

§

CustomVecOne(Vec<Self>)

👎Deprecated since 0.1.18:

Please use the ‘UnaryList’ variant instead.

Deprecated: One-vector-argument custom operation.

§

CustomVecTwo(Vec<Self>, Vec<Self>)

👎Deprecated since 0.1.18:

Please use the ‘BinaryList’ variant instead.

Deprecated: Two-vector-argument custom operation.

§

CustomVecThree(Vec<Self>, Vec<Self>, Vec<Self>)

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Deprecated: Three-vector-argument custom operation.

§

CustomVecFour(Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>)

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Deprecated: Four-vector-argument custom operation.

§

CustomVecFive(Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>)

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Deprecated: Five-vector-argument custom operation.

§

UnaryList(String, Arc<Self>)

Generic unary operation identified by a name.

This variant allows for extensible unary operations without modifying the Expr enum. Operations are registered in the DYNAMIC_OP_REGISTRY with their properties (associativity, commutativity, etc.). This is part of the plugin system and future-proofing strategy.

§Examples

use std::sync::Arc;

use rssn::symbolic::core::DynamicOpProperties;
use rssn::symbolic::core::Expr;
use rssn::symbolic::core::register_dynamic_op;

// Register a custom operation
register_dynamic_op(
    "my_func",
    DynamicOpProperties {
        name: "my_func".to_string(),
        description: "My custom function".to_string(),
        is_associative: false,
        is_commutative: false,
    },
);

// Use it
let expr = Expr::UnaryList(
    "my_func".to_string(),
    Arc::new(Expr::Variable("x".to_string())),
);
§

BinaryList(String, Arc<Self>, Arc<Self>)

Generic binary operation identified by a name.

This variant allows for extensible binary operations without modifying the Expr enum. Operations are registered in the DYNAMIC_OP_REGISTRY with their properties.

§Examples

use std::sync::Arc;

use rssn::symbolic::core::DynamicOpProperties;
use rssn::symbolic::core::Expr;
use rssn::symbolic::core::register_dynamic_op;

// Register a custom binary operation
register_dynamic_op(
    "my_binop",
    DynamicOpProperties {
        name: "my_binop".to_string(),
        description: "My custom binary operation".to_string(),
        is_associative: true,
        is_commutative: true,
    },
);

// Use it
let expr = Expr::BinaryList(
    "my_binop".to_string(),
    Arc::new(Expr::Variable("x".to_string())),
    Arc::new(Expr::Variable("y".to_string())),
);
§

NaryList(String, Vec<Self>)

Generic n-ary operation identified by a name.

This variant allows for extensible n-ary operations without modifying the Expr enum. Operations are registered in the DYNAMIC_OP_REGISTRY with their properties. This is particularly useful for operations that can take a variable number of arguments.

§Examples

use rssn::symbolic::core::DynamicOpProperties;
use rssn::symbolic::core::Expr;
use rssn::symbolic::core::register_dynamic_op;

// Register a custom n-ary operation
register_dynamic_op(
    "my_nary",
    DynamicOpProperties {
        name: "my_nary".to_string(),
        description: "My custom n-ary operation".to_string(),
        is_associative: true,
        is_commutative: false,
    },
);

// Use it
let expr = Expr::NaryList(
    "my_nary".to_string(),
    vec![
        Expr::Variable("a".to_string()),
        Expr::Variable("b".to_string()),
        Expr::Variable("c".to_string()),
    ],
);

Implementations§

Source§

impl Expr

Source

pub fn new_sin<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Sin

Source

pub fn new_cos<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Cos

Source

pub fn new_tan<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Tan

Source

pub fn new_exp<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Exp

Source

pub fn new_log<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Log

Source

pub fn new_neg<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Neg

Source

pub fn new_abs<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Abs

Source

pub fn new_sqrt<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Sqrt

Source

pub fn new_transpose<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Transpose

Source

pub fn new_inverse<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Inverse

Source

pub fn new_sec<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Sec

Source

pub fn new_csc<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Csc

Source

pub fn new_cot<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Cot

Source

pub fn new_arcsin<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcSin

Source

pub fn new_arccos<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcCos

Source

pub fn new_arctan<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcTan

Source

pub fn new_arcsec<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcSec

Source

pub fn new_arccsc<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcCsc

Source

pub fn new_arccot<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcCot

Source

pub fn new_sinh<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Sinh

Source

pub fn new_cosh<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Cosh

Source

pub fn new_tanh<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Tanh

Source

pub fn new_sech<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Sech

Source

pub fn new_csch<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Csch

Source

pub fn new_coth<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Coth

Source

pub fn new_arcsinh<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcSinh

Source

pub fn new_arccosh<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcCosh

Source

pub fn new_arctanh<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcTanh

Source

pub fn new_arcsech<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcSech

Source

pub fn new_arccsch<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcCsch

Source

pub fn new_arccoth<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. ArcCoth

Source

pub fn new_not<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Not

Source

pub fn new_floor<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Floor

Source

pub fn new_gamma<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Gamma

Source

pub fn new_erf<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Erf

Source

pub fn new_erfc<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Erfc

Source

pub fn new_erfi<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Erfi

Source

pub fn new_zeta<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Zeta

Source

pub fn new_digamma<A>(a: A) -> Expr
where A: AsRef<Expr>,

Creates a new expression, managed by the DAG. Digamma

Source

pub fn new_add<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Add

Source

pub fn new_sub<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Sub

Source

pub fn new_mul<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Mul

Source

pub fn new_div<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Div

Source

pub fn new_pow<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Power

Source

pub fn new_complex<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Complex

Source

pub fn new_matrix_mul<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. MatrixMul

Source

pub fn new_matrix_vec_mul<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. MatrixVecMul

Source

pub fn new_log_base<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. LogBase

Source

pub fn new_atan2<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Atan2

Source

pub fn new_xor<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Xor

Source

pub fn new_implies<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Implies

Source

pub fn new_equivalent<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Equivalent

Source

pub fn new_beta<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Beta

Source

pub fn new_bessel_j<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. BesselJ

Source

pub fn new_bessel_y<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. BesselY

Source

pub fn new_legendre_p<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. LegendreP

Source

pub fn new_laguerre_l<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. LaguerreL

Source

pub fn new_hermite_h<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. HermiteH

Source

pub fn new_kronecker_delta<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. KroneckerDelta

Source

pub fn new_apply<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

Creates a new expression, managed by the DAG. Apply

Source

pub fn new_vector<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

Creates a new expression, managed by the DAG. Vector

Source

pub fn new_and<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

Creates a new expression, managed by the DAG. And

Source

pub fn new_or<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

Creates a new expression, managed by the DAG. Or

Source

pub fn new_union<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

Creates a new expression, managed by the DAG. Union

Source

pub fn new_polynomial<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

Creates a new expression, managed by the DAG. Polynomial

Source

pub fn new_tuple<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

Creates a new expression, managed by the DAG. Tuple

Source

pub fn new_custom_arc_one<A>(a: A) -> Expr
where A: AsRef<Expr>,

👎Deprecated since 0.1.18:

Please use the ‘UnaryList’ variant instead.

Creates a new expression, managed by the DAG. CustomArcOne

Source

pub fn new_custom_arc_two<A, B>(a: A, b: B) -> Expr
where A: AsRef<Expr>, B: AsRef<Expr>,

👎Deprecated since 0.1.18:

Please use the ‘BinaryList’ variant instead.

Creates a new expression, managed by the DAG. CustomArcTwo

Source

pub fn new_custom_vec_one<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new expression, managed by the DAG. CustomVecOne

Source

pub fn new_custom_vec_two<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new expression, managed by the DAG. CustomVecTwo

Source

pub fn new_custom_vec_three<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new expression, managed by the DAG. CustomVecThree

Source

pub fn new_custom_vec_four<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new expression, managed by the DAG. CustomVecFour

Source

pub fn new_custom_vec_five<I, T>(elements: I) -> Expr
where I: IntoIterator<Item = T>, T: AsRef<Expr>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new expression, managed by the DAG. CustomVecFive

Source

pub fn new_constant(c: f64) -> Self

Creates a new Constant expression, managed by the DAG.

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_variable(name: &str) -> Self

Creates a new Variable expression, managed by the DAG.

§Panics

Panics if the variable cannot be created in the DAG.

Source

pub fn new_bigint(i: BigInt) -> Self

Creates a new BigInt expression, managed by the DAG.

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_rational(r: BigRational) -> Self

Creates a new Rational expression, managed by the DAG.

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_pi() -> Self

Creates a new Pi expression, managed by the DAG.

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_e() -> Self

Creates a new E expression, managed by the DAG.

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_infinity() -> Self

Creates a new Infinity expression, managed by the DAG.

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_negative_infinity() -> Self

Creates a new NegativeInfinity expression, managed by the DAG.

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_matrix<I, J, T>(elements: I) -> Self
where I: IntoIterator<Item = J>, J: IntoIterator<Item = T>, T: AsRef<Self>,

Creates a new Matrix expression, managed by the DAG.

§Panics

Panics if the matrix rows have inconsistent length or if elements cannot be created in the DAG.

Source

pub fn new_predicate<I, T>(name: &str, args: I) -> Self
where I: IntoIterator<Item = T>, T: AsRef<Self>,

Creates a new Predicate expression, managed by the DAG.

§Panics

Panics if the predicate or its arguments cannot be created in the DAG.

Source

pub fn new_forall<A>(var: &str, expr: A) -> Self
where A: AsRef<Self>,

Creates a new ForAll quantifier expression, managed by the DAG.

§Panics

Panics if the expression cannot be created in the DAG.

Source

pub fn new_exists<A>(var: &str, expr: A) -> Self
where A: AsRef<Self>,

Creates a new Exists quantifier expression, managed by the DAG.

§Panics

Panics if the expression cannot be created in the DAG.

Source

pub fn new_interval<A, B>( lower: A, upper: B, incl_lower: bool, incl_upper: bool, ) -> Self
where A: AsRef<Self>, B: AsRef<Self>,

Creates a new Interval expression, managed by the DAG.

§Panics

Panics if the interval boundaries cannot be created in the DAG.

Source

pub fn new_derivative<A>(function: A, variable: String) -> Self
where A: AsRef<Self>,

Creates a new Derivative expression, managed by the DAG.

§Panics

Panics if the polynomial cannot be created in the DAG.

Source

pub fn new_derivativen<A, B>(function: A, variable: String, grades: B) -> Self
where A: AsRef<Self>, B: AsRef<Self>,

Creates a new DerivativeN expression, managed by the DAG.

§Panics

Panics if the polynomial cannot be created in the DAG.

Source

pub fn new_indefinite_sum<A, B>(body: A, variable: String, step: B) -> Self
where A: AsRef<Self>, B: AsRef<Self>,

Creates a new IndefiniteSum expression, managed by the DAG.

§Panics

Panics if the expression cannot be created in the DAG.

Source

pub fn new_indefinite_product<A, B>(body: A, variable: String, step: B) -> Self
where A: AsRef<Self>, B: AsRef<Self>,

Creates a new IndefiniteProduct expression, managed by the DAG.

§Panics

Panics if the expression cannot be created in the DAG.

Source

pub fn new_sparse_polynomial(p: SparsePolynomial) -> Self

Creates a new SparsePolynomial expression, managed by the DAG.

§Panics

Panics if the polynomial cannot be created in the DAG.

Source

pub fn new_custom_zero() -> Self

👎Deprecated since 0.1.18:

Please use the ‘UnaryList’ variant instead.

Creates a new CustomZero expression (deprecated).

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_custom_string(s: &str) -> Self

👎Deprecated since 0.1.18:

Please use the ‘UnaryList’ variant instead.

Creates a new CustomString expression (deprecated).

§Panics

Panics if the value cannot be created in the DAG.

Source

pub fn new_custom_arc_three<A, B, C>(a: A, b: B, c: C) -> Self
where A: AsRef<Self>, B: AsRef<Self>, C: AsRef<Self>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new CustomArcThree expression (deprecated).

§Panics

Panics if the arguments cannot be created in the DAG.

Source

pub fn new_custom_arc_four<A, B, C, D>(a: A, b: B, c: C, d: D) -> Self
where A: AsRef<Self>, B: AsRef<Self>, C: AsRef<Self>, D: AsRef<Self>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new CustomArcFour expression (deprecated).

§Panics

Panics if the arguments cannot be created in the DAG.

Source

pub fn new_custom_arc_five<A, B, C, D, E>(a: A, b: B, c: C, d: D, e: E) -> Self
where A: AsRef<Self>, B: AsRef<Self>, C: AsRef<Self>, D: AsRef<Self>, E: AsRef<Self>,

👎Deprecated since 0.1.18:

Please use the ‘NaryList’ variant instead.

Creates a new CustomArcFive expression (deprecated).

§Panics

Panics if the arguments cannot be created in the DAG.

Source

pub const fn is_dag(&self) -> bool

Checks if this expression is in DAG form.

§Returns
  • true if the expression is Expr::Dag, false otherwise
§Examples
use rssn::symbolic::core::Expr;

let dag_expr = Expr::new_variable("x");

assert!(dag_expr.is_dag());

let ast_expr = Expr::Constant(1.0);

assert!(!ast_expr.is_dag());
Source

pub fn to_dag(&self) -> Result<Self, String>

Converts this expression to DAG form if not already.

This is a key function for the AST→DAG migration. It ensures that any expression, whether in old AST form or new DAG form, is converted to a canonical DAG representation.

§Returns
  • Ok(Expr::Dag) - The expression in DAG form
  • Err(String) - If conversion fails
§Errors

Returns an error if conversion from AST to DAG fails.

§Examples
use std::sync::Arc;

use rssn::symbolic::core::Expr;

// Old AST form
let ast = Expr::Add(
    Arc::new(Expr::Variable("x".to_string())),
    Arc::new(Expr::Constant(1.0)),
);

// Convert to DAG
let dag = ast.to_dag().unwrap();

assert!(dag.is_dag());
Source

pub fn to_dag_form(&mut self)

Converts this expression to DAG form in-place.

This is a convenience method that converts the expression to DAG form and replaces the current value.

§Examples
use rssn::symbolic::core::Expr;

let mut expr = Expr::Constant(1.0);

assert!(!expr.is_dag());

expr.to_dag_form();

assert!(expr.is_dag());
Source

pub fn to_ast(&self) -> Result<Self, String>

Converts a DAG expression back to AST form (for serialization).

This is used internally for backward-compatible serialization. Note: This may fail for expressions that cannot be represented in AST form.

§Returns
  • Ok(Expr) - The expression in AST form
  • Err(String) - If conversion fails
§Errors

Returns an error if conversion from DAG to AST fails.

Source§

impl Expr

Source

pub fn sin(&self) -> Self

Returns the sine of the expression.

Source

pub fn cos(&self) -> Self

Returns the cosine of the expression.

Source

pub fn tan(&self) -> Self

Returns the tangent of the expression.

Source

pub fn exp(&self) -> Self

Returns the natural exponential of the expression (e^x).

Source

pub fn ln(&self) -> Self

Returns the natural logarithm of the expression.

Source

pub fn log<B: AsRef<Self>>(&self, base: B) -> Self

Returns the logarithm of the expression with a specified base.

Source

pub fn abs(&self) -> Self

Returns the absolute value of the expression.

Source

pub fn sqrt(&self) -> Self

Returns the square root of the expression.

Source

pub fn pow<E: AsRef<Self>>(&self, exponent: E) -> Self

Returns the expression raised to the power of another expression.

Source

pub fn asin(&self) -> Self

Returns the arcsine of the expression.

Source

pub fn acos(&self) -> Self

Returns the arccosine of the expression.

Source

pub fn atan(&self) -> Self

Returns the arctangent of the expression.

Source

pub fn sinh(&self) -> Self

Returns the hyperbolic sine of the expression.

Source

pub fn cosh(&self) -> Self

Returns the hyperbolic cosine of the expression.

Source

pub fn tanh(&self) -> Self

Returns the hyperbolic tangent of the expression.

Source§

impl Expr

Source

pub fn re(&self) -> Self

Returns the real part of the expression.

Source

pub fn im(&self) -> Self

Returns the imaginary part of the expression.

Source

pub fn to_f64(&self) -> Option<f64>

Attempts to convert the expression to a 64-bit float.

Source

pub fn op(&self) -> DagOp

Returns the operation type of the expression in a unified way.

This method handles both regular expressions and DAG nodes, returning the operation regardless of internal representation.

§Returns
  • DagOp - The operation type corresponding to this expression
§Panics

Panics if the expression cannot be converted to a DagOp.

Source

pub fn children(&self) -> Vec<Self>

Returns the children of the expression in a unified way.

This method handles both regular expressions and DAG nodes, returning the direct child expressions regardless of internal representation.

§Returns
  • Vec<Expr> - A vector containing the direct children of this expression
Source§

impl Expr

Source

pub fn pre_order_walk<F>(&self, f: &mut F)
where F: FnMut(&Self),

Performs a pre-order traversal of the expression tree. It visits the current node first, then its children.

§Arguments
  • f - A mutable function that takes a reference to an Expr and is applied to each node during traversal
Source

pub fn post_order_walk<F>(&self, f: &mut F)
where F: FnMut(&Self),

Performs a post-order traversal of the expression tree. It visits the children first, then the current node.

§Arguments
  • f - A mutable function that takes a reference to an Expr and is applied to each node during traversal
Source

pub fn in_order_walk<F>(&self, f: &mut F)
where F: FnMut(&Self),

Performs an in-order traversal of the expression tree. For binary operators, it visits the left child, the node itself, then the right child. For other nodes, the behavior is adapted as it’s not strictly defined.

§Arguments
  • f - A mutable function that takes a reference to an Expr and is applied to each node during traversal
Source

pub fn normalize(&self) -> Self

Normalizes the expression by sorting sub-expressions of commutative operators.

This helps in identifying identical expressions that differ only in terms of operand order.

Source§

impl Expr

Source

pub fn clone_box_dist(&self) -> Result<Arc<dyn Distribution>, String>

Clones the distribution if the expression represents a probability distribution.

§Errors

Returns an error if the expression is not a distribution.

Source

pub fn clone_box_quant(&self) -> Result<Arc<UnitQuantity>, String>

Clones the unit quantity if the expression represents a quantity.

§Errors

Returns an error if the expression is not a quantity.

Trait Implementations§

Source§

impl Add for Expr

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Expr) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Expr> for Expr

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Expr) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Expr) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Expr> for f64

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Expr) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Expr) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Expr> for f64

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Expr) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for Expr

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for &Expr

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl AsRef<Expr> for Expr

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Expr

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Expr

Source§

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

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

impl<'de> Deserialize<'de> for Expr

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Expr

Source§

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

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

impl Div for Expr

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Expr) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Expr> for Expr

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Expr) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Expr) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Expr> for f64

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Expr) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Expr) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Expr> for f64

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Expr) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for Expr

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for &Expr

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Eq for Expr

Source§

impl From<DagNode> for Expr

Source§

fn from(node: DagNode) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Expr

Source§

fn from(val: f64) -> Self

Converts to this type from the input type.
Source§

impl Hash for Expr

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Mul for Expr

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Expr) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Expr> for Expr

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Expr) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Expr) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Expr> for f64

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Expr) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Expr) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Expr> for f64

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Expr) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Expr> for Multivector

Source§

type Output = Multivector

The resulting type after applying the * operator.
Source§

fn mul(self, scalar: Expr) -> Self

Performs the * operation. Read more
Source§

impl Mul<f64> for Expr

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for &Expr

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Neg for Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for &Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Ord for Expr

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Expr

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Expr

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Expr

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Sub for Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Expr) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&Expr> for Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Expr) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Expr) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&Expr> for f64

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Expr) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Expr> for &Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Expr) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Expr> for f64

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Expr) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for &Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl ToExpr for Expr

Source§

fn to_expr(&self) -> Expr

Converts the value into a symbolic Expr.

Auto Trait Implementations§

§

impl Freeze for Expr

§

impl RefUnwindSafe for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl UnsafeUnpin for Expr

§

impl UnwindSafe for Expr

Blanket Implementations§

Source§

impl<Rhs, Lhs, Output> AddByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Add<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn add_by_ref(&self, rhs: &Rhs) -> <Lhs as AddByRef<Rhs>>::Output

Source§

impl<T> AlignerFor<1> for T

Source§

type Aligner = AlignTo1<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<2> for T

Source§

type Aligner = AlignTo2<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<4> for T

Source§

type Aligner = AlignTo4<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<8> for T

Source§

type Aligner = AlignTo8<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<16> for T

Source§

type Aligner = AlignTo16<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<32> for T

Source§

type Aligner = AlignTo32<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<64> for T

Source§

type Aligner = AlignTo64<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<128> for T

Source§

type Aligner = AlignTo128<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<256> for T

Source§

type Aligner = AlignTo256<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<512> for T

Source§

type Aligner = AlignTo512<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<1024> for T

Source§

type Aligner = AlignTo1024<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<2048> for T

Source§

type Aligner = AlignTo2048<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<4096> for T

Source§

type Aligner = AlignTo4096<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<8192> for T

Source§

type Aligner = AlignTo8192<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<16384> for T

Source§

type Aligner = AlignTo16384<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

impl<T> AlignerFor<32768> for T

Source§

type Aligner = AlignTo32768<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'short, T, Target> AsGeneralizedRef<'short, &'short Target> for T
where T: AsRef<Target> + ?Sized, Target: ?Sized,

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

Source§

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<Rhs, Lhs, Output> DivByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Div<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn div_by_ref(&self, rhs: &Rhs) -> <Lhs as DivByRef<Rhs>>::Output

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<Rhs, Lhs, Output> MulByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Mul<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn mul_by_ref(&self, rhs: &Rhs) -> <Lhs as MulByRef<Rhs>>::Output

Source§

impl<T, Output> NegByRef for T
where &'a T: for<'a> Neg<Output = Output>,

Source§

type Output = Output

Source§

fn neg_by_ref(&self) -> <T as NegByRef>::Output

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<'a, T> RCowCompatibleRef<'a> for T
where T: Clone + 'a,

Source§

type RefC = &'a T

The (preferably) ffi-safe equivalent of &Self.
Source§

type ROwned = T

The owned version of Self::RefC.
Source§

fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC

Converts a reference to an FFI-safe type
Source§

fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T

Converts an FFI-safe type to a reference
Source§

impl<S> ROExtAcc for S

Source§

fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F

Gets a reference to a field, determined by offset. Read more
Source§

fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F

Gets a muatble reference to a field, determined by offset. Read more
Source§

fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F

Gets a const pointer to a field, the field is determined by offset. Read more
Source§

fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F

Gets a mutable pointer to a field, determined by offset. Read more
Source§

impl<S> ROExtOps<Aligned> for S

Source§

fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more
Source§

fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Aligned>, right: &mut S)

Swaps a field (determined by offset) with the same field in right. Read more
Source§

fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> F
where F: Copy,

Gets a copy of a field (determined by offset). The field is determined by offset. Read more
Source§

impl<S> ROExtOps<Unaligned> for S

Source§

fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more
Source§

fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, right: &mut S)

Swaps a field (determined by offset) with the same field in right. Read more
Source§

fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> F
where F: Copy,

Gets a copy of a field (determined by offset). The field is determined by offset. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> SelfOps for T
where T: ?Sized,

Source§

fn eq_id(&self, other: &Self) -> bool

Compares the address of self with the address of other. Read more
Source§

fn piped<F, U>(self, f: F) -> U
where F: FnOnce(Self) -> U, Self: Sized,

Emulates the pipeline operator, allowing method syntax in more places. Read more
Source§

fn piped_ref<'a, F, U>(&'a self, f: F) -> U
where F: FnOnce(&'a Self) -> U,

The same as piped except that the function takes &Self Useful for functions that take &Self instead of Self. Read more
Source§

fn piped_mut<'a, F, U>(&'a mut self, f: F) -> U
where F: FnOnce(&'a mut Self) -> U,

The same as piped, except that the function takes &mut Self. Useful for functions that take &mut Self instead of Self.
Source§

fn mutated<F>(self, f: F) -> Self
where F: FnOnce(&mut Self), Self: Sized,

Mutates self using a closure taking self by mutable reference, passing it along the method chain. Read more
Source§

fn observe<F>(self, f: F) -> Self
where F: FnOnce(&Self), Self: Sized,

Observes the value of self, passing it along unmodified. Useful in long method chains. Read more
Source§

fn into_<T>(self) -> T
where Self: Into<T>,

Performs a conversion with Into. using the turbofish .into_::<_>() syntax. Read more
Source§

fn as_ref_<T>(&self) -> &T
where Self: AsRef<T>, T: ?Sized,

Performs a reference to reference conversion with AsRef, using the turbofish .as_ref_::<_>() syntax. Read more
Source§

fn as_mut_<T>(&mut self) -> &mut T
where Self: AsMut<T>, T: ?Sized,

Performs a mutable reference to mutable reference conversion with AsMut, using the turbofish .as_mut_::<_>() syntax. Read more
Source§

fn drop_(self)
where Self: Sized,

Drops self using method notation. Alternative to std::mem::drop. Read more
Source§

impl<T> SendAlias for T

Source§

impl<Rhs, Lhs, Output> SubByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Sub<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn sub_by_ref(&self, rhs: &Rhs) -> <Lhs as SubByRef<Rhs>>::Output

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

unsafe fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> SyncAlias for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

impl<This> TransmuteElement for This
where This: ?Sized,

Source§

unsafe fn transmute_element<T>(self) -> Self::TransmutedPtr
where Self: CanTransmuteElement<T>,

Transmutes the element type of this pointer.. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> TypeIdentity for T
where T: ?Sized,

Source§

type Type = T

This is always Self.
Source§

fn into_type(self) -> Self::Type
where Self: Sized, Self::Type: Sized,

Converts a value back to the original type.
Source§

fn as_type(&self) -> &Self::Type

Converts a reference back to the original type.
Source§

fn as_type_mut(&mut self) -> &mut Self::Type

Converts a mutable reference back to the original type.
Source§

fn into_type_box(self: Box<Self>) -> Box<Self::Type>

Converts a box back to the original type.
Source§

fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>

Converts an Arc back to the original type. Read more
Source§

fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>

Converts an Rc back to the original type. Read more
Source§

fn from_type(this: Self::Type) -> Self
where Self: Sized, Self::Type: Sized,

Converts a value back to the original type.
Source§

fn from_type_ref(this: &Self::Type) -> &Self

Converts a reference back to the original type.
Source§

fn from_type_mut(this: &mut Self::Type) -> &mut Self

Converts a mutable reference back to the original type.
Source§

fn from_type_box(this: Box<Self::Type>) -> Box<Self>

Converts a box back to the original type.
Source§

fn from_type_arc(this: Arc<Self::Type>) -> Arc<Self>

Converts an Arc back to the original type.
Source§

fn from_type_rc(this: Rc<Self::Type>) -> Rc<Self>

Converts an Rc back to the original type.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<This> ValidTag_Bounds for This
where This: Debug + Clone + PartialEq,