Enum mathml::ast::MathExpression
source · pub enum MathExpression {
Show 28 variants
Mi(Mi),
Mo(Operator),
Mn(String),
Msqrt(Box<MathExpression>),
Mrow(Mrow),
Mfrac(Box<MathExpression>, Box<MathExpression>),
Msup(Box<MathExpression>, Box<MathExpression>),
Msub(Box<MathExpression>, Box<MathExpression>),
Munder(Box<MathExpression>, Box<MathExpression>),
Mover(Box<MathExpression>, Box<MathExpression>),
Msubsup(Box<MathExpression>, Box<MathExpression>, Box<MathExpression>),
Mtext(String),
Mstyle(Vec<MathExpression>),
Mspace(String),
MoLine(String),
Ci(Ci),
Differential(Differential),
SummationMath(SummationMath),
AbsoluteSup(Box<MathExpression>, Box<MathExpression>),
Absolute(Box<MathExpression>, Box<MathExpression>),
HatComp(HatComp),
Integral(Integral),
LaplacianComp(LaplacianComp),
SurfaceIntegral(Box<MathExpression>),
DownArrow(DownArrow),
Minimize(Box<MathExpression>, Vec<MathExpression>),
ExpMath(ExpMath),
None,
}
Expand description
The MathExpression enum is not faithful to the corresponding element type in MathML 3 (https://www.w3.org/TR/MathML3/appendixa.html#parsing_MathExpression)
Variants§
Mi(Mi)
Mo(Operator)
Mn(String)
Represents numeric literals such as integers, decimals
Msqrt(Box<MathExpression>)
Represents square root elements
Mrow(Mrow)
Mfrac(Box<MathExpression>, Box<MathExpression>)
Represents the fraction of expressions where first argument is numerator content and second argument is denominator content
Msup(Box<MathExpression>, Box<MathExpression>)
Represents expressions where first argument is the base and second argument is the superscript
Msub(Box<MathExpression>, Box<MathExpression>)
Represents expressions where first argument is the base and second argument is the subscript
Munder(Box<MathExpression>, Box<MathExpression>)
Represents expressions where first argument is the base and second argument is the undersubscript
Mover(Box<MathExpression>, Box<MathExpression>)
Represents expressions where first argument is the base and second argument is the oversubscript
Msubsup(Box<MathExpression>, Box<MathExpression>, Box<MathExpression>)
Represents expressions where first argument is the base, second argument is the subscript, third argument is the superscript
Mtext(String)
Represents arbitrary text
Mstyle(Vec<MathExpression>)
Represents how elements can make changes to their style. E.g. displaystyle
Mspace(String)
Represents empty element with blanck space
MoLine(String)
Handles <mo …/>
Ci(Ci)
Differential(Differential)
SummationMath(SummationMath)
AbsoluteSup(Box<MathExpression>, Box<MathExpression>)
Absolute(Box<MathExpression>, Box<MathExpression>)
HatComp(HatComp)
Integral(Integral)
LaplacianComp(LaplacianComp)
SurfaceIntegral(Box<MathExpression>)
Represents closed surface integral over contents. E.g. \oiint_S ∇ \cdot T dS
DownArrow(DownArrow)
↓ as an operator e.g. I↓ indicates downward diffuse radiative fluxes per unit indcident flux
Minimize(Box<MathExpression>, Vec<MathExpression>)
ExpMath(ExpMath)
None
Implementations§
source§impl MathExpression
impl MathExpression
sourcepub fn new_msqrt(f0: Box<MathExpression>) -> Self
pub fn new_msqrt(f0: Box<MathExpression>) -> Self
Constructs a new MathExpression::Msqrt
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_mfrac(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
pub fn new_mfrac(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
Constructs a new MathExpression::Mfrac
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_msup(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
pub fn new_msup(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
Constructs a new MathExpression::Msup
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_msub(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
pub fn new_msub(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
Constructs a new MathExpression::Msub
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_munder(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
pub fn new_munder(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
Constructs a new MathExpression::Munder
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_mover(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
pub fn new_mover(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
Constructs a new MathExpression::Mover
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_msubsup(
f0: Box<MathExpression>,
f1: Box<MathExpression>,
f2: Box<MathExpression>
) -> Self
pub fn new_msubsup( f0: Box<MathExpression>, f1: Box<MathExpression>, f2: Box<MathExpression> ) -> Self
Constructs a new MathExpression::Msubsup
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_mstyle(f0: Vec<MathExpression>) -> Self
pub fn new_mstyle(f0: Vec<MathExpression>) -> Self
Constructs a new MathExpression::Mstyle
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_mspace(f0: String) -> Self
pub fn new_mspace(f0: String) -> Self
Constructs a new MathExpression::Mspace
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_mo_line(f0: String) -> Self
pub fn new_mo_line(f0: String) -> Self
Constructs a new MathExpression::MoLine
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_differential(f0: Differential) -> Self
pub fn new_differential(f0: Differential) -> Self
Constructs a new MathExpression::Differential
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_summation_math(f0: SummationMath) -> Self
pub fn new_summation_math(f0: SummationMath) -> Self
Constructs a new MathExpression::SummationMath
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_absolute_sup(
f0: Box<MathExpression>,
f1: Box<MathExpression>
) -> Self
pub fn new_absolute_sup( f0: Box<MathExpression>, f1: Box<MathExpression> ) -> Self
Constructs a new MathExpression::AbsoluteSup
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_absolute(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
pub fn new_absolute(f0: Box<MathExpression>, f1: Box<MathExpression>) -> Self
Constructs a new MathExpression::Absolute
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_hat_comp(f0: HatComp) -> Self
pub fn new_hat_comp(f0: HatComp) -> Self
Constructs a new MathExpression::HatComp
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_integral(f0: Integral) -> Self
pub fn new_integral(f0: Integral) -> Self
Constructs a new MathExpression::Integral
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_laplacian_comp(f0: LaplacianComp) -> Self
pub fn new_laplacian_comp(f0: LaplacianComp) -> Self
Constructs a new MathExpression::LaplacianComp
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_surface_integral(f0: Box<MathExpression>) -> Self
pub fn new_surface_integral(f0: Box<MathExpression>) -> Self
Constructs a new MathExpression::SurfaceIntegral
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_down_arrow(f0: DownArrow) -> Self
pub fn new_down_arrow(f0: DownArrow) -> Self
Constructs a new MathExpression::DownArrow
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_minimize(f0: Box<MathExpression>, f1: Vec<MathExpression>) -> Self
pub fn new_minimize(f0: Box<MathExpression>, f1: Vec<MathExpression>) -> Self
Constructs a new MathExpression::Minimize
.
source§impl MathExpression
impl MathExpression
sourcepub fn new_exp_math(f0: ExpMath) -> Self
pub fn new_exp_math(f0: ExpMath) -> Self
Constructs a new MathExpression::ExpMath
.
source§impl MathExpression
impl MathExpression
pub fn add_to_graph<'a>( &'a self, graph: &mut ASTGraph<'a>, parent_index: Option<NodeIndex> )
source§impl MathExpression
impl MathExpression
sourcepub fn get_string_repr(&self) -> String
pub fn get_string_repr(&self) -> String
Get the string representation of a MathExpression
Trait Implementations§
source§impl Clone for MathExpression
impl Clone for MathExpression
source§fn clone(&self) -> MathExpression
fn clone(&self) -> MathExpression
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MathExpression
impl Debug for MathExpression
source§impl Default for MathExpression
impl Default for MathExpression
source§fn default() -> MathExpression
fn default() -> MathExpression
source§impl<'de> Deserialize<'de> for MathExpression
impl<'de> Deserialize<'de> for MathExpression
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>,
source§impl Display for MathExpression
impl Display for MathExpression
source§impl Hash for MathExpression
impl Hash for MathExpression
source§impl JsonSchema for MathExpression
impl JsonSchema for MathExpression
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl Ord for MathExpression
impl Ord for MathExpression
source§fn cmp(&self, other: &MathExpression) -> Ordering
fn cmp(&self, other: &MathExpression) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for MathExpression
impl PartialEq for MathExpression
source§fn eq(&self, other: &MathExpression) -> bool
fn eq(&self, other: &MathExpression) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MathExpression
impl PartialOrd for MathExpression
source§fn partial_cmp(&self, other: &MathExpression) -> Option<Ordering>
fn partial_cmp(&self, other: &MathExpression) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for MathExpression
impl Serialize for MathExpression
source§impl<'__s> ToSchema<'__s> for MathExpression
impl<'__s> ToSchema<'__s> for MathExpression
impl Eq for MathExpression
impl StructuralPartialEq for MathExpression
Auto Trait Implementations§
impl RefUnwindSafe for MathExpression
impl Send for MathExpression
impl Sync for MathExpression
impl Unpin for MathExpression
impl UnwindSafe for MathExpression
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
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
key
and return true
if they are equal.