pub enum MathElem<I = String> {
Chars(String),
Group(Vec<MathElem<I>>),
Sub(Box<MathElem<I>>, Vec<MathElem<I>>),
Sup(Box<MathElem<I>>, Vec<MathElem<I>>),
Primes(Box<MathElem<I>>, usize),
Cmd {
name: I,
span: Span,
args: Vec<CmdArg<I>>,
},
Embed {
expr: Ast<I>,
span: Span,
},
}Expand description
One quoted math element (structure mirrors the mathmain/mathtop/
mathbot rules; only carried, not typeset, until later).
Variants§
Chars(String)
A run of math characters/symbols (MATHCHAR).
Group(Vec<MathElem<I>>)
{ … } grouping.
Sub(Box<MathElem<I>>, Vec<MathElem<I>>)
base _ script
Sup(Box<MathElem<I>>, Vec<MathElem<I>>)
base ^ script
Primes(Box<MathElem<I>>, usize)
base '+ (primes count as a superscript)
Cmd
\cmd args… in math mode; sigil included. args is CmdArg-shaped
for uniformity with IText::Cmd/BText::Cmd (the runtime command
fold is shared across all three); the math-mode application grammar
has no ?(l=e) bundle form at all (math command arguments are
always bracket groups — {…} / !{…} / !<…> / !(…), upstream
narg), so every CmdArg here has opts: vec![] by construction.
Embed
#x in math mode.
Implementations§
Trait Implementations§
impl<I: PartialEq> StructuralPartialEq for MathElem<I>
Auto Trait Implementations§
impl<I = String> !Send for MathElem<I>
impl<I = String> !Sync for MathElem<I>
impl<I> Freeze for MathElem<I>
impl<I> RefUnwindSafe for MathElem<I>where
Vec<MathElem<I>>: RefUnwindSafe,
Box<MathElem<I>>: RefUnwindSafe,
I: RefUnwindSafe,
Vec<CmdArg<I>>: RefUnwindSafe,
Ast<I>: RefUnwindSafe,
impl<I> Unpin for MathElem<I>
impl<I> UnsafeUnpin for MathElem<I>where
Vec<MathElem<I>>: UnsafeUnpin,
Box<MathElem<I>>: UnsafeUnpin,
I: UnsafeUnpin,
Vec<CmdArg<I>>: UnsafeUnpin,
Ast<I>: UnsafeUnpin,
impl<I> UnwindSafe for MathElem<I>where
Vec<MathElem<I>>: UnwindSafe,
Box<MathElem<I>>: UnwindSafe,
I: UnwindSafe,
Vec<CmdArg<I>>: UnwindSafe,
Ast<I>: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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