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
VolumeIntegral
A volume integral of a scalar field over a specified volume.
Fields
SurfaceIntegral
A surface integral of a vector field over a specified surface.
Fields
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
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
IndefiniteProduct
An indefinite product of body with variable var and step size step.
Fields
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.
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
RootOf
Represents the i-th root of a polynomial.
Fields
InfiniteSolutions
Represents infinite solutions.
NoSolution
Represents that no solution exists.
Ode
An ordinary differential equation (ODE).
Fields
Pde
A partial differential equation (PDE).
Fields
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
Please use the ‘UnaryList’ variant instead.
Deprecated: Zero-argument custom operation.
CustomString(String)
Please use the ‘UnaryList’ variant instead.
Deprecated: String-argument custom operation.
CustomArcOne(Arc<Self>)
Please use the ‘UnaryList’ variant instead.
Deprecated: One-arc-argument custom operation.
CustomArcTwo(Arc<Self>, Arc<Self>)
Please use the ‘BinaryList’ variant instead.
Deprecated: Two-arc-argument custom operation.
CustomArcThree(Arc<Self>, Arc<Self>, Arc<Self>)
Please use the ‘NaryList’ variant instead.
Deprecated: Three-arc-argument custom operation.
CustomArcFour(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>)
Please use the ‘NaryList’ variant instead.
Deprecated: Four-arc-argument custom operation.
CustomArcFive(Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>, Arc<Self>)
Please use the ‘NaryList’ variant instead.
Deprecated: Five-arc-argument custom operation.
CustomVecOne(Vec<Self>)
Please use the ‘UnaryList’ variant instead.
Deprecated: One-vector-argument custom operation.
CustomVecTwo(Vec<Self>, Vec<Self>)
Please use the ‘BinaryList’ variant instead.
Deprecated: Two-vector-argument custom operation.
CustomVecThree(Vec<Self>, Vec<Self>, Vec<Self>)
Please use the ‘NaryList’ variant instead.
Deprecated: Three-vector-argument custom operation.
CustomVecFour(Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>)
Please use the ‘NaryList’ variant instead.
Deprecated: Four-vector-argument custom operation.
CustomVecFive(Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>, Vec<Self>)
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
impl Expr
Sourcepub fn new_transpose<A>(a: A) -> Expr
pub fn new_transpose<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. Transpose
Sourcepub fn new_inverse<A>(a: A) -> Expr
pub fn new_inverse<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. Inverse
Sourcepub fn new_arcsin<A>(a: A) -> Expr
pub fn new_arcsin<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcSin
Sourcepub fn new_arccos<A>(a: A) -> Expr
pub fn new_arccos<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcCos
Sourcepub fn new_arctan<A>(a: A) -> Expr
pub fn new_arctan<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcTan
Sourcepub fn new_arcsec<A>(a: A) -> Expr
pub fn new_arcsec<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcSec
Sourcepub fn new_arccsc<A>(a: A) -> Expr
pub fn new_arccsc<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcCsc
Sourcepub fn new_arccot<A>(a: A) -> Expr
pub fn new_arccot<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcCot
Sourcepub fn new_arcsinh<A>(a: A) -> Expr
pub fn new_arcsinh<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcSinh
Sourcepub fn new_arccosh<A>(a: A) -> Expr
pub fn new_arccosh<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcCosh
Sourcepub fn new_arctanh<A>(a: A) -> Expr
pub fn new_arctanh<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcTanh
Sourcepub fn new_arcsech<A>(a: A) -> Expr
pub fn new_arcsech<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcSech
Sourcepub fn new_arccsch<A>(a: A) -> Expr
pub fn new_arccsch<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcCsch
Sourcepub fn new_arccoth<A>(a: A) -> Expr
pub fn new_arccoth<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. ArcCoth
Sourcepub fn new_digamma<A>(a: A) -> Expr
pub fn new_digamma<A>(a: A) -> Expr
Creates a new expression, managed by the DAG. Digamma
Sourcepub fn new_complex<A, B>(a: A, b: B) -> Expr
pub fn new_complex<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. Complex
Sourcepub fn new_matrix_mul<A, B>(a: A, b: B) -> Expr
pub fn new_matrix_mul<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. MatrixMul
Sourcepub fn new_matrix_vec_mul<A, B>(a: A, b: B) -> Expr
pub fn new_matrix_vec_mul<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. MatrixVecMul
Sourcepub fn new_log_base<A, B>(a: A, b: B) -> Expr
pub fn new_log_base<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. LogBase
Sourcepub fn new_implies<A, B>(a: A, b: B) -> Expr
pub fn new_implies<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. Implies
Sourcepub fn new_equivalent<A, B>(a: A, b: B) -> Expr
pub fn new_equivalent<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. Equivalent
Sourcepub fn new_bessel_j<A, B>(a: A, b: B) -> Expr
pub fn new_bessel_j<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. BesselJ
Sourcepub fn new_bessel_y<A, B>(a: A, b: B) -> Expr
pub fn new_bessel_y<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. BesselY
Sourcepub fn new_legendre_p<A, B>(a: A, b: B) -> Expr
pub fn new_legendre_p<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. LegendreP
Sourcepub fn new_laguerre_l<A, B>(a: A, b: B) -> Expr
pub fn new_laguerre_l<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. LaguerreL
Sourcepub fn new_hermite_h<A, B>(a: A, b: B) -> Expr
pub fn new_hermite_h<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. HermiteH
Sourcepub fn new_kronecker_delta<A, B>(a: A, b: B) -> Expr
pub fn new_kronecker_delta<A, B>(a: A, b: B) -> Expr
Creates a new expression, managed by the DAG. KroneckerDelta
Sourcepub fn new_vector<I, T>(elements: I) -> Expr
pub fn new_vector<I, T>(elements: I) -> Expr
Creates a new expression, managed by the DAG. Vector
Sourcepub fn new_union<I, T>(elements: I) -> Expr
pub fn new_union<I, T>(elements: I) -> Expr
Creates a new expression, managed by the DAG. Union
Sourcepub fn new_polynomial<I, T>(elements: I) -> Expr
pub fn new_polynomial<I, T>(elements: I) -> Expr
Creates a new expression, managed by the DAG. Polynomial
Sourcepub fn new_tuple<I, T>(elements: I) -> Expr
pub fn new_tuple<I, T>(elements: I) -> Expr
Creates a new expression, managed by the DAG. Tuple
Sourcepub fn new_custom_arc_one<A>(a: A) -> Expr
👎Deprecated since 0.1.18: Please use the ‘UnaryList’ variant instead.
pub fn new_custom_arc_one<A>(a: A) -> Expr
Please use the ‘UnaryList’ variant instead.
Creates a new expression, managed by the DAG. CustomArcOne
Sourcepub fn new_custom_arc_two<A, B>(a: A, b: B) -> Expr
👎Deprecated since 0.1.18: Please use the ‘BinaryList’ variant instead.
pub fn new_custom_arc_two<A, B>(a: A, b: B) -> Expr
Please use the ‘BinaryList’ variant instead.
Creates a new expression, managed by the DAG. CustomArcTwo
Sourcepub fn new_custom_vec_one<I, T>(elements: I) -> Expr
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_vec_one<I, T>(elements: I) -> Expr
Please use the ‘NaryList’ variant instead.
Creates a new expression, managed by the DAG. CustomVecOne
Sourcepub fn new_custom_vec_two<I, T>(elements: I) -> Expr
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_vec_two<I, T>(elements: I) -> Expr
Please use the ‘NaryList’ variant instead.
Creates a new expression, managed by the DAG. CustomVecTwo
Sourcepub fn new_custom_vec_three<I, T>(elements: I) -> Expr
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_vec_three<I, T>(elements: I) -> Expr
Please use the ‘NaryList’ variant instead.
Creates a new expression, managed by the DAG. CustomVecThree
Sourcepub fn new_custom_vec_four<I, T>(elements: I) -> Expr
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_vec_four<I, T>(elements: I) -> Expr
Please use the ‘NaryList’ variant instead.
Creates a new expression, managed by the DAG. CustomVecFour
Sourcepub fn new_custom_vec_five<I, T>(elements: I) -> Expr
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_vec_five<I, T>(elements: I) -> Expr
Please use the ‘NaryList’ variant instead.
Creates a new expression, managed by the DAG. CustomVecFive
Sourcepub fn new_constant(c: f64) -> Self
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.
Sourcepub fn new_variable(name: &str) -> Self
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.
Sourcepub fn new_bigint(i: BigInt) -> Self
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.
Sourcepub fn new_rational(r: BigRational) -> Self
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.
Sourcepub fn new_pi() -> Self
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.
Sourcepub fn new_e() -> Self
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.
Sourcepub fn new_infinity() -> Self
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.
Sourcepub fn new_negative_infinity() -> Self
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.
Sourcepub fn new_matrix<I, J, T>(elements: I) -> Self
pub fn new_matrix<I, J, T>(elements: I) -> 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.
Sourcepub fn new_predicate<I, T>(name: &str, args: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: AsRef<Self>,
pub fn new_predicate<I, T>(name: &str, args: I) -> Selfwhere
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.
Sourcepub fn new_forall<A>(var: &str, expr: A) -> Selfwhere
A: AsRef<Self>,
pub fn new_forall<A>(var: &str, expr: A) -> Selfwhere
A: AsRef<Self>,
Creates a new ForAll quantifier expression, managed by the DAG.
§Panics
Panics if the expression cannot be created in the DAG.
Sourcepub fn new_exists<A>(var: &str, expr: A) -> Selfwhere
A: AsRef<Self>,
pub fn new_exists<A>(var: &str, expr: A) -> Selfwhere
A: AsRef<Self>,
Creates a new Exists quantifier expression, managed by the DAG.
§Panics
Panics if the expression cannot be created in the DAG.
Sourcepub fn new_interval<A, B>(
lower: A,
upper: B,
incl_lower: bool,
incl_upper: bool,
) -> Self
pub fn new_interval<A, B>( lower: A, upper: B, incl_lower: bool, incl_upper: bool, ) -> Self
Creates a new Interval expression, managed by the DAG.
§Panics
Panics if the interval boundaries cannot be created in the DAG.
Sourcepub fn new_derivative<A>(function: A, variable: String) -> Selfwhere
A: AsRef<Self>,
pub fn new_derivative<A>(function: A, variable: String) -> Selfwhere
A: AsRef<Self>,
Creates a new Derivative expression, managed by the DAG.
§Panics
Panics if the polynomial cannot be created in the DAG.
Sourcepub fn new_derivativen<A, B>(function: A, variable: String, grades: B) -> Self
pub fn new_derivativen<A, B>(function: A, variable: String, grades: B) -> Self
Creates a new DerivativeN expression, managed by the DAG.
§Panics
Panics if the polynomial cannot be created in the DAG.
Sourcepub fn new_indefinite_sum<A, B>(body: A, variable: String, step: B) -> Self
pub fn new_indefinite_sum<A, B>(body: A, variable: String, step: B) -> Self
Creates a new IndefiniteSum expression, managed by the DAG.
§Panics
Panics if the expression cannot be created in the DAG.
Sourcepub fn new_indefinite_product<A, B>(body: A, variable: String, step: B) -> Self
pub fn new_indefinite_product<A, B>(body: A, variable: String, step: B) -> Self
Creates a new IndefiniteProduct expression, managed by the DAG.
§Panics
Panics if the expression cannot be created in the DAG.
Sourcepub fn new_sparse_polynomial(p: SparsePolynomial) -> Self
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.
Sourcepub fn new_custom_zero() -> Self
👎Deprecated since 0.1.18: Please use the ‘UnaryList’ variant instead.
pub fn new_custom_zero() -> Self
Please use the ‘UnaryList’ variant instead.
Creates a new CustomZero expression (deprecated).
§Panics
Panics if the value cannot be created in the DAG.
Sourcepub fn new_custom_string(s: &str) -> Self
👎Deprecated since 0.1.18: Please use the ‘UnaryList’ variant instead.
pub fn new_custom_string(s: &str) -> Self
Please use the ‘UnaryList’ variant instead.
Creates a new CustomString expression (deprecated).
§Panics
Panics if the value cannot be created in the DAG.
Sourcepub fn new_custom_arc_three<A, B, C>(a: A, b: B, c: C) -> Self
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_arc_three<A, B, C>(a: A, b: B, c: C) -> Self
Please use the ‘NaryList’ variant instead.
Creates a new CustomArcThree expression (deprecated).
§Panics
Panics if the arguments cannot be created in the DAG.
Sourcepub fn new_custom_arc_four<A, B, C, D>(a: A, b: B, c: C, d: D) -> Self
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_arc_four<A, B, C, D>(a: A, b: B, c: C, d: D) -> Self
Please use the ‘NaryList’ variant instead.
Creates a new CustomArcFour expression (deprecated).
§Panics
Panics if the arguments cannot be created in the DAG.
Sourcepub fn new_custom_arc_five<A, B, C, D, E>(a: A, b: B, c: C, d: D, e: E) -> Self
👎Deprecated since 0.1.18: Please use the ‘NaryList’ variant instead.
pub fn new_custom_arc_five<A, B, C, D, E>(a: A, b: B, c: C, d: D, e: E) -> Self
Please use the ‘NaryList’ variant instead.
Creates a new CustomArcFive expression (deprecated).
§Panics
Panics if the arguments cannot be created in the DAG.
Sourcepub fn to_dag(&self) -> Result<Self, String>
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 formErr(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());Sourcepub fn to_dag_form(&mut self)
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());Sourcepub fn to_ast(&self) -> Result<Self, String>
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 formErr(String)- If conversion fails
§Errors
Returns an error if conversion from DAG to AST fails.
Source§impl Expr
impl Expr
Source§impl Expr
impl Expr
Sourcepub fn op(&self) -> DagOp
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.
Sourcepub fn children(&self) -> Vec<Self>
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
impl Expr
Sourcepub fn pre_order_walk<F>(&self, f: &mut F)where
F: FnMut(&Self),
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 anExprand is applied to each node during traversal
Sourcepub fn post_order_walk<F>(&self, f: &mut F)where
F: FnMut(&Self),
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 anExprand is applied to each node during traversal
Sourcepub fn in_order_walk<F>(&self, f: &mut F)where
F: FnMut(&Self),
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 anExprand is applied to each node during traversal
Source§impl Expr
impl Expr
Sourcepub fn clone_box_dist(&self) -> Result<Arc<dyn Distribution>, String>
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.
Sourcepub fn clone_box_quant(&self) -> Result<Arc<UnitQuantity>, String>
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<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Expr
Source§impl Mul<Expr> for Multivector
impl Mul<Expr> for Multivector
Source§impl Ord for Expr
impl Ord for Expr
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Expr
impl PartialOrd for 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<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<'short, T, Target> AsGeneralizedRef<'short, &'short Target> for T
impl<'short, T, Target> AsGeneralizedRef<'short, &'short Target> for T
fn as_generalized_ref(&'short self) -> &'short Target
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ClosedNeg for Twhere
T: Neg<Output = T>,
impl<T> ClosedNeg for Twhere
T: Neg<Output = T>,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
impl<T> Scalar for T
impl<T> Scalar for T
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped except that the function takes &Self
Useful for functions that take &Self instead of Self. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
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
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef,
using the turbofish .as_ref_::<_>() syntax. Read moreimpl<T> SendAlias for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.