pub enum AlgebraicExpression<T, R> {
Reference(R),
Number(T),
BinaryOperation(AlgebraicBinaryOperation<T, R>),
UnaryOperation(AlgebraicUnaryOperation<T, R>),
}Variants§
Reference(R)
Number(T)
BinaryOperation(AlgebraicBinaryOperation<T, R>)
UnaryOperation(AlgebraicUnaryOperation<T, R>)
Implementations§
Source§impl<T, R> AlgebraicExpression<T, R>
impl<T, R> AlgebraicExpression<T, R>
pub fn new_binary(left: Self, op: AlgebraicBinaryOperator, right: Self) -> Self
pub fn new_unary(op: AlgebraicUnaryOperator, expr: Self) -> Self
Trait Implementations§
Source§impl<T, R> Add for AlgebraicExpression<T, R>
impl<T, R> Add for AlgebraicExpression<T, R>
Source§impl<T, R> AllChildren<AlgebraicExpression<T, R>> for AlgebraicExpression<T, R>
impl<T, R> AllChildren<AlgebraicExpression<T, R>> for AlgebraicExpression<T, R>
Source§fn all_children(
&self,
) -> Box<dyn Iterator<Item = &AlgebraicExpression<T, R>> + '_>
fn all_children( &self, ) -> Box<dyn Iterator<Item = &AlgebraicExpression<T, R>> + '_>
Returns an iterator over all direct and indirect children of kind
O in this object.
If O and Self are the same type, also includes self.
Pre-order visitor.Source§impl<T: Clone, R: Clone> Clone for AlgebraicExpression<T, R>
impl<T: Clone, R: Clone> Clone for AlgebraicExpression<T, R>
Source§fn clone(&self) -> AlgebraicExpression<T, R>
fn clone(&self) -> AlgebraicExpression<T, R>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, T, R> Deserialize<'de> for AlgebraicExpression<T, R>where
T: Deserialize<'de>,
R: Deserialize<'de>,
impl<'de, T, R> Deserialize<'de> for AlgebraicExpression<T, R>where
T: Deserialize<'de>,
R: Deserialize<'de>,
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, R> Display for AlgebraicExpression<T, R>where
R: Display,
T: Display,
AlgebraicBinaryOperation<T, R>: Display,
AlgebraicUnaryOperation<T, R>: Display,
impl<T, R> Display for AlgebraicExpression<T, R>where
R: Display,
T: Display,
AlgebraicBinaryOperation<T, R>: Display,
AlgebraicUnaryOperation<T, R>: Display,
impl<T: Eq, R: Eq> Eq for AlgebraicExpression<T, R>
Source§impl<T, R> ExpressionConvertible<T, R> for AlgebraicExpression<T, R>
impl<T, R> ExpressionConvertible<T, R> for AlgebraicExpression<T, R>
Source§fn to_expression<E: Add<E, Output = E> + Sub<E, Output = E> + Mul<E, Output = E> + Neg<Output = E>>(
&self,
number_converter: &impl Fn(&T) -> E,
var_converter: &impl Fn(&R) -> E,
) -> E
fn to_expression<E: Add<E, Output = E> + Sub<E, Output = E> + Mul<E, Output = E> + Neg<Output = E>>( &self, number_converter: &impl Fn(&T) -> E, var_converter: &impl Fn(&R) -> E, ) -> E
Converts
self into a structure that supports algebraic operations. Read moreSource§impl<T, R> ExpressionVisitable<AlgebraicExpression<T, R>> for AlgebraicExpression<T, R>
impl<T, R> ExpressionVisitable<AlgebraicExpression<T, R>> for AlgebraicExpression<T, R>
fn visit_expressions_mut<F, B>( &mut self, f: &mut F, o: VisitOrder, ) -> ControlFlow<B>
fn visit_expressions<F, B>(&self, f: &mut F, o: VisitOrder) -> ControlFlow<B>
Source§fn pre_visit_expressions_mut<F>(&mut self, f: &mut F)
fn pre_visit_expressions_mut<F>(&mut self, f: &mut F)
Traverses the AST and calls
f on each Expression in pre-order.Source§impl<T, R> From<T> for AlgebraicExpression<T, R>
impl<T, R> From<T> for AlgebraicExpression<T, R>
Source§impl<T: JsonSchema, R: JsonSchema> JsonSchema for AlgebraicExpression<T, R>
impl<T: JsonSchema, R: JsonSchema> JsonSchema for AlgebraicExpression<T, R>
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl<T, R> Mul for AlgebraicExpression<T, R>
impl<T, R> Mul for AlgebraicExpression<T, R>
Source§impl<T, R> Neg for AlgebraicExpression<T, R>
impl<T, R> Neg for AlgebraicExpression<T, R>
Source§impl<T: Ord, R: Ord> Ord for AlgebraicExpression<T, R>
impl<T: Ord, R: Ord> Ord for AlgebraicExpression<T, R>
Source§fn cmp(&self, other: &AlgebraicExpression<T, R>) -> Ordering
fn cmp(&self, other: &AlgebraicExpression<T, R>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd, R: PartialOrd> PartialOrd for AlgebraicExpression<T, R>
impl<T: PartialOrd, R: PartialOrd> PartialOrd for AlgebraicExpression<T, R>
Source§impl<T, R> Serialize for AlgebraicExpression<T, R>
impl<T, R> Serialize for AlgebraicExpression<T, R>
impl<T: PartialEq, R: PartialEq> StructuralPartialEq for AlgebraicExpression<T, R>
Auto Trait Implementations§
impl<T, R> Freeze for AlgebraicExpression<T, R>
impl<T, R> RefUnwindSafe for AlgebraicExpression<T, R>where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, R> Send for AlgebraicExpression<T, R>
impl<T, R> Sync for AlgebraicExpression<T, R>
impl<T, R> Unpin for AlgebraicExpression<T, R>
impl<T, R> UnsafeUnpin for AlgebraicExpression<T, R>where
R: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, R> UnwindSafe for AlgebraicExpression<T, R>where
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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