Token

Enum Token 

Source
pub enum Token<'config> {
Show 64 variants Eof, Begin(Env), End(Env), NewColumn, NewLine, NoNumber, Tag, Left, Right, Middle, SquareBracketOpen, SquareBracketClose, GroupBegin, GroupEnd, Frac(Option<FracAttr>), Genfrac, Underscore, Circumflex, Binom(Option<FracAttr>), Overset, Underset, OverUnderBrace(OrdLike, bool), Sqrt, Integral(Op), Limits, PseudoOperatorLimits(&'static str), Space(Length), CustomSpace, NonBreakingSpace, Whitespace, Transform(MathVariant), Big(Size, Option<Class>), OverUnder(Rel, bool, Option<OpAttr>), Ord(OrdLike), Op(Op), BinaryOp(Bin), Relation(Rel), Open(Fence), Close(Fence), Punctuation(Punct), Inner(Op), Prime, OpGreaterThan, OpLessThan, OpAmpersand, ForceRelation(MathMLOperator), ForceClose(MathMLOperator), ForceBinaryOp(MathMLOperator), Letter(char, FromAscii), UprightLetter(char), Digit(char), PseudoOperator(&'static str), Enclose(Notation), OperatorName(bool), Slashed, Not, Text(Option<HtmlTextStyle>), Style(Style), Color, CustomCmdArg(u8), CustomCmd(u8, &'config [Token<'static>]), HardcodedMathML(&'static str), TextModeAccent(char), InternalStringLiteral(&'static str),
}

Variants§

§

Eof

§

Begin(Env)

§

End(Env)

§

NewColumn

§

NewLine

§

NoNumber

§

Tag

§

Left

§

Right

§

Middle

§

SquareBracketOpen

The opening square bracket has its own token because we need to distinguish it from \lbrack after \sqrt.

§

SquareBracketClose

The closing square bracket has its own token because we often need to search for it. Additionally, it’s useful to distinguish this from \rbrack.

§

GroupBegin

§

GroupEnd

§

Frac(Option<FracAttr>)

§

Genfrac

§

Underscore

§

Circumflex

§

Binom(Option<FracAttr>)

§

Overset

§

Underset

§

OverUnderBrace(OrdLike, bool)

§

Sqrt

§

Integral(Op)

§

Limits

§

PseudoOperatorLimits(&'static str)

§

Space(Length)

§

CustomSpace

§

NonBreakingSpace

§

Whitespace

§

Transform(MathVariant)

§

Big(Size, Option<Class>)

§

OverUnder(Rel, bool, Option<OpAttr>)

§

Ord(OrdLike)

A token corresponding to LaTeX’s “mathord” character class (class 0).

§

Op(Op)

A token corresponding to LaTeX’s “mathop” character class (class 1).

§

BinaryOp(Bin)

A token corresponding to LaTeX’s “mathbin” character class (class 2).

§

Relation(Rel)

A token corresponding to LaTeX’s “mathrel” character class (class 3).

§

Open(Fence)

A token corresponding to LaTeX’s “mathopen” character class (class 4).

§

Close(Fence)

A token corresponding to LaTeX’s “mathclose” character class (class 5).

§

Punctuation(Punct)

A token corresponding to LaTeX’s “mathpunct” character class (class 6).

§

Inner(Op)

A token corresponding to LaTeX’s “mathinner” character class (class I).

§

Prime

§

OpGreaterThan

§

OpLessThan

§

OpAmpersand

§

ForceRelation(MathMLOperator)

A token to force an operator to behave like a relation (mathrel). This is, for example, needed for :, which in LaTeX is a relation, but in MathML Core is a separator (punctuation).

§

ForceClose(MathMLOperator)

A token to force an operator to behave like a closing symbol (mathclose). This is, for example, needed for !, which in LaTeX is a closing symbol, but in MathML Core is an ordinary operator.

§

ForceBinaryOp(MathMLOperator)

A token to force an operator to behave like a binary operator (mathbin). This is, for example, needed for ×, which in LaTeX is a binary operator, but in MathML Core is a “big operator” (mathop).

§

Letter(char, FromAscii)

§

UprightLetter(char)

§

Digit(char)

§

PseudoOperator(&'static str)

§

Enclose(Notation)

§

OperatorName(bool)

§

Slashed

§

Not

§

Text(Option<HtmlTextStyle>)

§

Style(Style)

§

Color

§

CustomCmdArg(u8)

§

CustomCmd(u8, &'config [Token<'static>])

§

HardcodedMathML(&'static str)

§

TextModeAccent(char)

§

InternalStringLiteral(&'static str)

This token is intended to be used in predefined token streams. It is equivalent to {abc}, but has a much more compact representation.

Trait Implementations§

Source§

impl<'config> Clone for Token<'config>

Source§

fn clone(&self) -> Token<'config>

Returns a duplicate 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<'config> Debug for Token<'config>

Source§

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

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

impl<'config, '_derivative_strum> From<&'_derivative_strum Token<'config>> for &'static str

Source§

fn from(x: &'_derivative_strum Token<'config>) -> &'static str

Converts to this type from the input type.
Source§

impl<'config> From<Token<'config>> for &'static str

Source§

fn from(x: Token<'config>) -> &'static str

Converts to this type from the input type.
Source§

impl<'config> Copy for Token<'config>

Auto Trait Implementations§

§

impl<'config> Freeze for Token<'config>

§

impl<'config> RefUnwindSafe for Token<'config>

§

impl<'config> Send for Token<'config>

§

impl<'config> Sync for Token<'config>

§

impl<'config> Unpin for Token<'config>

§

impl<'config> UnwindSafe for Token<'config>

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, 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.