[][src]Struct asciimath_rs::elements::special::Expression

pub struct Expression {
    pub children: Vec<Element>,
}

Fields

children: Vec<Element>

Implementations

impl Expression[src]

pub fn new() -> Self[src]

pub fn add_child(&mut self, child: Element)[src]

Trait Implementations

impl Clone for Expression[src]

impl Debug for Expression[src]

impl PartialEq<Expression> for Expression[src]

impl PartialOrd<Expression> for Expression[src]

impl StructuralPartialEq for Expression[src]

impl ToMathML for Expression[src]

fn to_mathml(&self) -> String[src]

Recursively converts the Expression into a MathML representation.

The result needs to be enclosed in <math></math> elements when used within an html file. Currently MathML is only natively supported by Firefox and Safari.

Example:

 use asciimath_rs::format::mathml::ToMathML;

 fn main() {
     let expression = asciimath_rs::parse("sin(2x - 1) + 2".to_string());
     println!("<math>{}</math>", expression.to_mathml());
 }

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.