Enum MathML

Source
pub enum MathML {
Show 20 variants Root(Box<MathRoot>), Row(Box<MathRow>), Space(Box<MathSpace>), Number(Box<MathNumber>), Identifier(Box<MathIdentifier>), Text(Box<MathText>), Operator(Box<MathOperator>), MultiScripts(Box<MathMultiScript>), UnderOver(Box<MathUnderOver>), Function(Box<MathFunction>), Sqrt(Box<MathSqrt>), Frac(Box<MathFraction>), Phantom(Box<MathPhantom>), Style(Box<MathStyle>), Fenced(Box<MathFenced>), Table(Box<MathTable>), Undefined(Box<MathError>), Ampersand, NewLine, Nothing,
}
Expand description

Represent the MathML AST node, For semantic considerations, not exactly the same as the standard.

Variants§

§

Root(Box<MathRoot>)

§

Row(Box<MathRow>)

§

Space(Box<MathSpace>)

§

Number(Box<MathNumber>)

§

Identifier(Box<MathIdentifier>)

§

Text(Box<MathText>)

§

Operator(Box<MathOperator>)

§

MultiScripts(Box<MathMultiScript>)

§

UnderOver(Box<MathUnderOver>)

§

Function(Box<MathFunction>)

Used for compatibility of \operatorname in LaTeX

§

Sqrt(Box<MathSqrt>)

§

Frac(Box<MathFraction>)

§

Phantom(Box<MathPhantom>)

§

Style(Box<MathStyle>)

§

Fenced(Box<MathFenced>)

<mfenced>, but polyfill as <mrow>

§

Table(Box<MathTable>)

§

Undefined(Box<MathError>)

Used for unknown element

§

Ampersand

Used for compatibility of & in LaTeX

§

NewLine

Used for compatibility of \\ in LaTeX

§

Nothing

Used for compatibility of &nbsp; in HTML

Implementations§

Source§

impl MathML

Source

pub fn identifier<S>(text: S) -> Self
where S: ToString,

Creates a new MathIdentifier with the FontVariant::Italic variant.

Source

pub fn text<S>(text: S) -> Self
where S: ToString,

Creates a new MathText with the FontVariant::Normal variant.

Source

pub fn string<S>(text: S) -> Self
where S: ToString,

Creates a new MathText with the FontVariant::Normal variant.

Source§

impl MathML

Source

pub fn number<N>(n: N) -> Self
where N: Into<MathNumber>,

Creates a new MathNumber with the given number.

Source

pub fn fraction<N, D>(numerator: N, denominator: D) -> Self
where N: Into<MathML>, D: Into<MathML>,

Creates a new MathFraction with the given numerator and denominator.

Source

pub fn error<S>(message: S) -> Self
where S: ToString,

Creates a new MathError with the given message.

Source§

impl MathML

Source

pub fn operation<S>(text: S) -> Self
where S: ToString,

Create a new MathML element with the given tag name.

Trait Implementations§

Source§

impl Clone for MathML

Source§

fn clone(&self) -> MathML

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MathML

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MathML

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<MathError> for MathML

Source§

fn from(value: MathError) -> Self

Converts to this type from the input type.
Source§

impl From<MathFenced> for MathML

Source§

fn from(value: MathFenced) -> Self

Converts to this type from the input type.
Source§

impl From<MathFraction> for MathML

Source§

fn from(value: MathFraction) -> Self

Converts to this type from the input type.
Source§

impl From<MathFunction> for MathML

Source§

fn from(value: MathFunction) -> Self

Converts to this type from the input type.
Source§

impl From<MathIdentifier> for MathML

Source§

fn from(value: MathIdentifier) -> Self

Converts to this type from the input type.
Source§

impl From<MathMultiScript> for MathML

Source§

fn from(value: MathMultiScript) -> Self

Converts to this type from the input type.
Source§

impl From<MathNumber> for MathML

Source§

fn from(value: MathNumber) -> Self

Converts to this type from the input type.
Source§

impl From<MathOperator> for MathML

Source§

fn from(value: MathOperator) -> Self

Converts to this type from the input type.
Source§

impl From<MathPhantom> for MathML

Source§

fn from(value: MathPhantom) -> Self

Converts to this type from the input type.
Source§

impl From<MathRoot> for MathML

Source§

fn from(value: MathRoot) -> Self

Converts to this type from the input type.
Source§

impl From<MathRow> for MathML

Source§

fn from(value: MathRow) -> Self

Converts to this type from the input type.
Source§

impl From<MathSpace> for MathML

Source§

fn from(value: MathSpace) -> Self

Converts to this type from the input type.
Source§

impl From<MathSqrt> for MathML

Source§

fn from(value: MathSqrt) -> Self

Converts to this type from the input type.
Source§

impl From<MathStyle> for MathML

Source§

fn from(value: MathStyle) -> Self

Converts to this type from the input type.
Source§

impl From<MathTable> for MathML

Source§

fn from(value: MathTable) -> Self

Converts to this type from the input type.
Source§

impl From<MathText> for MathML

Source§

fn from(value: MathText) -> Self

Converts to this type from the input type.
Source§

impl From<MathUnderOver> for MathML

Source§

fn from(value: MathUnderOver) -> Self

Converts to this type from the input type.
Source§

impl From<char> for MathML

Source§

fn from(value: char) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for MathML

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for MathML

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for MathML

Source§

fn from(value: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for MathML

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for MathML

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for MathML

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for MathML

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for MathML

Source§

fn from(value: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for MathML

Source§

fn from(value: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for MathML

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for MathML

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for MathML

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for MathML

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for MathML

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MathML

Source§

fn eq(&self, other: &MathML) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MathML

Auto Trait Implementations§

§

impl Freeze for MathML

§

impl RefUnwindSafe for MathML

§

impl Send for MathML

§

impl Sync for MathML

§

impl Unpin for MathML

§

impl UnwindSafe for MathML

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.