pub enum MathExpressionTree {
Atom(MathExpression),
Cons(Operator, Vec<MathExpressionTree>),
}
Expand description
New whitespace handler before parsing An S-expression like structure to represent mathematical expressions.
Variants§
Atom(MathExpression)
Cons(Operator, Vec<MathExpressionTree>)
Implementations§
source§impl MathExpressionTree
impl MathExpressionTree
sourcepub fn new_atom(f0: MathExpression) -> Self
pub fn new_atom(f0: MathExpression) -> Self
Constructs a new MathExpressionTree::Atom
.
source§impl MathExpressionTree
impl MathExpressionTree
sourcepub fn new_cons(f0: Operator, f1: Vec<MathExpressionTree>) -> Self
pub fn new_cons(f0: Operator, f1: Vec<MathExpressionTree>) -> Self
Constructs a new MathExpressionTree::Cons
.
source§impl MathExpressionTree
impl MathExpressionTree
sourcepub fn to_cmml(&self) -> String
pub fn to_cmml(&self) -> String
Translates a MathExpressionTree struct to a content MathML string.
sourcepub fn to_infix_expression(&self) -> String
pub fn to_infix_expression(&self) -> String
Translates to infix math expression to provide “string expressions” (e.g. ((α*ρ)*I) ) TA-4 uses “string expressions” to display over the transitions in their visual front end.
Trait Implementations§
source§impl Clone for MathExpressionTree
impl Clone for MathExpressionTree
source§fn clone(&self) -> MathExpressionTree
fn clone(&self) -> MathExpressionTree
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MathExpressionTree
impl Debug for MathExpressionTree
source§impl<'de> Deserialize<'de> for MathExpressionTree
impl<'de> Deserialize<'de> for MathExpressionTree
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 Display for MathExpressionTree
impl Display for MathExpressionTree
Implementation of Display for MathExpressionTree, in order to have a compact string representation to work with — this is useful both for human inspection and writing unit tests.
source§impl From<Math> for MathExpressionTree
impl From<Math> for MathExpressionTree
source§impl From<Vec<MathExpression>> for MathExpressionTree
impl From<Vec<MathExpression>> for MathExpressionTree
source§fn from(input: Vec<MathExpression>) -> Self
fn from(input: Vec<MathExpression>) -> Self
Converts to this type from the input type.
source§impl FromStr for MathExpressionTree
impl FromStr for MathExpressionTree
source§impl Hash for MathExpressionTree
impl Hash for MathExpressionTree
source§impl JsonSchema for MathExpressionTree
impl JsonSchema for MathExpressionTree
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(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &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 Ord for MathExpressionTree
impl Ord for MathExpressionTree
source§fn cmp(&self, other: &MathExpressionTree) -> Ordering
fn cmp(&self, other: &MathExpressionTree) -> Ordering
1.21.0 · 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 PartialEq for MathExpressionTree
impl PartialEq for MathExpressionTree
source§fn eq(&self, other: &MathExpressionTree) -> bool
fn eq(&self, other: &MathExpressionTree) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MathExpressionTree
impl PartialOrd for MathExpressionTree
source§fn partial_cmp(&self, other: &MathExpressionTree) -> Option<Ordering>
fn partial_cmp(&self, other: &MathExpressionTree) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for MathExpressionTree
impl Serialize for MathExpressionTree
source§impl<'__s> ToSchema<'__s> for MathExpressionTree
impl<'__s> ToSchema<'__s> for MathExpressionTree
impl Eq for MathExpressionTree
impl StructuralPartialEq for MathExpressionTree
Auto Trait Implementations§
impl RefUnwindSafe for MathExpressionTree
impl Send for MathExpressionTree
impl Sync for MathExpressionTree
impl Unpin for MathExpressionTree
impl UnwindSafe for MathExpressionTree
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key
and return true
if they are equal.