Skip to main content

MathNode

Enum MathNode 

Source
pub enum MathNode<ET: EngineTypes, S: MathFontStyleT<ET>> {
Show 19 variants Atom(MathAtom<ET, S>), Penalty(i32), Mark(usize, TokenList<ET::Token>), Whatsit(WhatsitNode<ET>), HSkip(Skip<ET::Dim>), MSkip { skip: MuSkip<ET::MuDim>, style: S, }, HFil, HFill, HFilneg, Hss, Space, HKern(ET::Dim), MKern { kern: ET::MuDim, style: S, }, Leaders(Leaders<ET>), VRule { width: Option<ET::Dim>, height: Option<ET::Dim>, depth: Option<ET::Dim>, start: SourceRef<ET>, end: SourceRef<ET>, }, Over { start: SourceRef<ET>, end: SourceRef<ET>, top: Box<[MathNode<ET, S>]>, sep: Option<ET::Dim>, bottom: Box<[MathNode<ET, S>]>, left: Option<(ET::Char, S)>, right: Option<(ET::Char, S)>, }, Choice(S::Choice), Marker(S::Markers), Custom(ET::CustomNode),
}
Expand description

A math list node. Comes in two forms: an unresolved form, while the list is being constructed and the various font styles are not fixed yet (e.g. because an \atop comes later that shifts the font style), and a resolved form, where the fonts have been determined and are fixed. The parameter S:MathFontStyleT makes the distinction between the two forms. For S=MathFontStyle (the resolved form), this implements NodeTrait.

Variants§

§

Atom(MathAtom<ET, S>)

A math atom node (see MathAtom)

§

Penalty(i32)

A penalty node, as produced by \penalty.

§

Mark(usize, TokenList<ET::Token>)

A mark node, as produced by \mark.

§

Whatsit(WhatsitNode<ET>)

A whatsit node, as produced by \special, \write, etc.

§

HSkip(Skip<ET::Dim>)

A glue node, as produced by \hskip.

§

MSkip

A glue node, as produced by \mskip. If resolved, S provides the adequate em value.

Fields

§skip: MuSkip<ET::MuDim>
§style: S
§

HFil

A glue node, as produced by \hfil.

§

HFill

A glue node, as produced by \hfill.

§

HFilneg

A glue node, as produced by \hfilneg.

§

Hss

A glue node, as produced by \hss.

§

Space

A glue node, as produced by \

§

HKern(ET::Dim)

A kern node, as produced by \kern.

§

MKern

A kern node, as produced by \mkern.

Fields

§kern: ET::MuDim
§style: S
§

Leaders(Leaders<ET>)

A leaders node, as produced by \leaders or \cleaders or \xleaders.

§

VRule

A rule node, as produced by \vrule.

Fields

§width: Option<ET::Dim>

The provided width of the rule.

§height: Option<ET::Dim>

The provided height of the rule.

§depth: Option<ET::Dim>

The provided depth of the rule.

§start: SourceRef<ET>

The source reference for the start of the rule.

§end: SourceRef<ET>

The source reference for the end of the rule.

§

Over

A “generalized fraction”, as produced by \over, \atop, \above, \abovewithdelims, \overwithdelims, \atopwithdelims.

Fields

§start: SourceRef<ET>

The source reference for the start of the node.

§end: SourceRef<ET>

The source reference for the end of the node.

§top: Box<[MathNode<ET, S>]>

The numerator.

§sep: Option<ET::Dim>

The optional separator height.

§bottom: Box<[MathNode<ET, S>]>

The denominator.

§left: Option<(ET::Char, S)>

The optional left delimiter.

§right: Option<(ET::Char, S)>

The optional right delimiter.

§

Choice(S::Choice)

A \mathchoice node; if resolved, this is just a wrapper around more math nodes.

§

Marker(S::Markers)

Markers for the various font styles, e.g. \displaystyle, \textstyle, etc.

§

Custom(ET::CustomNode)

A custom node.

Implementations§

Source§

impl<ET: EngineTypes> MathNode<ET, UnresolvedMathFontStyle<ET>>

Source

pub fn nodetype(&self) -> NodeType

The node type of this node (as in \lastnodetype).

Source

pub fn opaque(&self) -> bool

Trait Implementations§

Source§

impl<ET: Clone + EngineTypes, S: Clone + MathFontStyleT<ET>> Clone for MathNode<ET, S>
where ET::Token: Clone, ET::Dim: Clone, ET::MuDim: Clone, ET::Char: Clone, S::Choice: Clone, S::Markers: Clone, ET::CustomNode: Clone,

Source§

fn clone(&self) -> MathNode<ET, S>

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<ET: Debug + EngineTypes, S: Debug + MathFontStyleT<ET>> Debug for MathNode<ET, S>
where ET::Token: Debug, ET::Dim: Debug, ET::MuDim: Debug, ET::Char: Debug, S::Choice: Debug, S::Markers: Debug, ET::CustomNode: Debug,

Source§

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

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

impl<ET: EngineTypes> NodeTrait<ET> for MathNode<ET, MathFontStyle<ET>>

Source§

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

Produces a human-readable string; since nodes are deeply nested, takes an additional indent value to indent the string
Source§

fn height(&self) -> ET::Dim

Returns the height of the node.
Source§

fn width(&self) -> ET::Dim

Returns the width of the node.
Source§

fn depth(&self) -> ET::Dim

Returns the depth of the node.
Source§

fn nodetype(&self) -> NodeType

Returns the type of the node, as returned by \lastnodetype.
Source§

fn opaque(&self) -> bool

Whether this node is “opaque”; meaning: When considering a list of nodes (e.g. in \unskip or \lastbox, this node should not be considered. Useful for annotation/marker nodes some engine wants to insert, without impacting algorithms that inspect e.g. the last node of the current list.
Source§

fn display(&self) -> DisplayNode<'_, ET, Self>

Returns a helper struct that implements Display and uses Self::display_fmt to yield a human-readable string.
Source§

fn sourceref(&self) -> Option<(&SourceRef<ET>, &SourceRef<ET>)>

Auto Trait Implementations§

§

impl<ET, S> !Freeze for MathNode<ET, S>

§

impl<ET, S> !RefUnwindSafe for MathNode<ET, S>

§

impl<ET, S> Send for MathNode<ET, S>
where S: Send, <ET as EngineTypes>::Dim: Send, <ET as EngineTypes>::MuDim: Send, <S as MathFontStyleT<ET>>::Choice: Send, <S as MathFontStyleT<ET>>::Markers: Send, <ET as EngineTypes>::CustomNode: Send, <<ET as EngineTypes>::File as File>::SourceRefID: Send, <ET as EngineTypes>::Char: Send, <ET as EngineTypes>::Font: Send, ET: Send,

§

impl<ET, S> !Sync for MathNode<ET, S>

§

impl<ET, S> Unpin for MathNode<ET, S>
where S: Unpin, <ET as EngineTypes>::Dim: Unpin, <ET as EngineTypes>::MuDim: Unpin, <S as MathFontStyleT<ET>>::Choice: Unpin, <S as MathFontStyleT<ET>>::Markers: Unpin, <ET as EngineTypes>::CustomNode: Unpin, <<ET as EngineTypes>::File as File>::SourceRefID: Unpin, <ET as EngineTypes>::Char: Unpin, <ET as EngineTypes>::Token: Unpin,

§

impl<ET, S> UnsafeUnpin for MathNode<ET, S>

§

impl<ET, S> UnwindSafe for MathNode<ET, S>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<ET, Err, A> IntoErr<ET, Err> for A
where ET: EngineTypes, Err: From<A>,

Source§

fn into_err( self, _aux: &EngineAux<ET>, _state: &<ET as EngineTypes>::State, ) -> Err

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more