Skip to main content

DefaultStomach

Struct DefaultStomach 

Source
pub struct DefaultStomach<ET: EngineTypes> { /* private fields */ }
Expand description

Default implementation of a Stomach

Trait Implementations§

Source§

impl<ET: EngineTypes> Stomach<ET> for DefaultStomach<ET>

Source§

fn new(_aux: &mut EngineAux<ET>, _state: &mut ET::State) -> Self

Constructs a new Stomach.
Source§

fn afterassignment(&mut self) -> &mut Option<ET::Token>

Mutable reference to the current \afterassignment Token.
Source§

fn data_mut(&mut self) -> &mut StomachData<ET>

The current list(s)
Source§

fn every_top(engine: &mut EngineReferences<'_, ET>)

To be executed at every iteration of the top-level loop - i.e. in between all unexpandable commands
Source§

fn flush(engine: &mut EngineReferences<'_, ET>) -> TeXResult<(), ET>

To be executed at the end of a document - flushes the current page
Source§

fn do_unexpandable( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, scope: CommandScope, token: ET::Token, apply: fn(&mut EngineReferences<'_, ET>, ET::Token) -> TeXResult<(), ET>, ) -> TeXResult<(), ET>

Execute the provided Unexpandable command
Source§

fn do_assignment( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, token: ET::Token, assign: fn(&mut EngineReferences<'_, ET>, ET::Token, bool) -> TeXResult<(), ET>, global: bool, ) -> TeXResult<(), ET>

Execute the provided Assignment command and insert \afterassignment if necessary
Source§

fn assign_font( engine: &mut EngineReferences<'_, ET>, _token: ET::Token, f: ET::Font, global: bool, ) -> TeXResult<(), ET>

Execute the provided Font assignment and insert \afterassignment if necessary
Source§

fn assign_int_register( engine: &mut EngineReferences<'_, ET>, register: usize, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a count register and insert \afterassignment if necessary
Source§

fn assign_dim_register( engine: &mut EngineReferences<'_, ET>, register: usize, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a dimen register and insert \afterassignment if necessary
Source§

fn assign_skip_register( engine: &mut EngineReferences<'_, ET>, register: usize, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a skip register and insert \afterassignment if necessary
Source§

fn assign_muskip_register( engine: &mut EngineReferences<'_, ET>, register: usize, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a muskip register and insert \afterassignment if necessary
Source§

fn assign_toks_register( engine: &mut EngineReferences<'_, ET>, token: ET::Token, register: usize, global: bool, ) -> TeXResult<(), ET>

Assign a value to a token register and insert \afterassignment if necessary
Source§

fn assign_primitive_toks( engine: &mut EngineReferences<'_, ET>, token: ET::Token, name: PrimitiveIdentifier, global: bool, ) -> TeXResult<(), ET>

Assign a value to a primitive token list and insert \afterassignment if necessary
Source§

fn assign_primitive_int( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a primitive integer value and insert \afterassignment if necessary
Source§

fn assign_primitive_dim( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a primitive dimension value and insert \afterassignment if necessary
Source§

fn assign_primitive_skip( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a primitive skip value and insert \afterassignment if necessary
Source§

fn assign_primitive_muskip( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, global: bool, in_token: ET::Token, ) -> TeXResult<(), ET>

Assign a value to a primitive muskip value and insert \afterassignment if necessary
Source§

fn do_whatsit( engine: &mut EngineReferences<'_, ET>, name: PrimitiveIdentifier, token: ET::Token, read: fn(&mut EngineReferences<'_, ET>, ET::Token) -> TeXResult<Option<Box<WhatsitFunction<ET>>>, ET>, ) -> TeXResult<(), ET>

Executes a Whatsit command
Source§

fn do_box( engine: &mut EngineReferences<'_, ET>, _name: PrimitiveIdentifier, token: ET::Token, bx: fn(&mut EngineReferences<'_, ET>, ET::Token) -> TeXResult<Either<Option<TeXBox<ET>>, BoxInfo<ET>>, ET>, ) -> TeXResult<(), ET>

Executes a Box command
Source§

fn do_char( engine: &mut EngineReferences<'_, ET>, token: ET::Token, char: ET::Char, code: CommandCode, ) -> TeXResult<(), ET>

Processes a character depending on the current TeXMode and its CommandCode
Source§

fn do_defed_char( engine: &mut EngineReferences<'_, ET>, token: ET::Token, char: ET::Char, ) -> TeXResult<(), ET>

Processes a character depending on the current TeXMode and its CommandCode
Source§

fn do_char_in_math( engine: &mut EngineReferences<'_, ET>, char: ET::Char, ) -> TeXResult<(), ET>

Source§

fn do_mathchar( engine: &mut EngineReferences<'_, ET>, code: u32, token: Option<ET::Token>, )

Processes a mathchar value (assumes we are in math mode)
Source§

fn close_box( engine: &mut EngineReferences<'_, ET>, bt: BoxType, ) -> TeXResult<(), ET>

Closes a node list belonging to a TeXBox and adds it to the corresponding node list
Source§

fn maybe_switch_mode( engine: &mut EngineReferences<'_, ET>, scope: CommandScope, token: ET::Token, name: PrimitiveIdentifier, ) -> TeXResult<bool, ET>

Switches the current TeXMode (if necessary) by opening/closing a paragraph, or throws an error if neither action is possible or would not result in a compatible mode. If a paragraph is opened or closed, the provided token is requeued to be reprocessed afterwards in horizontal/vertical mode, and false is returned (as to not process the triggering command further). Otherwise, all is well and true is returned.
Source§

fn open_align( engine: &mut EngineReferences<'_, ET>, _inner: BoxType, between: BoxType, )

Opens an \halign or \valign
Source§

fn close_align(engine: &mut EngineReferences<'_, ET>) -> TeXResult<(), ET>

Closes an \halign or \valign
Source§

fn add_node_m( engine: &mut EngineReferences<'_, ET>, node: MathNode<ET, UnresolvedMathFontStyle<ET>>, )

Adds a node to the current math list (i.e. assumes we’re in math mode)
Source§

fn add_node_h(engine: &mut EngineReferences<'_, ET>, node: HNode<ET>)

Adds a node to the current horizontal list (i.e. assumes we’re in (restricted) horizontal mode)
Source§

fn add_node_v( engine: &mut EngineReferences<'_, ET>, node: VNode<ET>, ) -> TeXResult<(), ET>

Adds a node to the current vertical list (i.e. assumes we’re in (internal) vertical mode)
Source§

fn maybe_do_output( engine: &mut EngineReferences<'_, ET>, penalty: Option<i32>, ) -> TeXResult<(), ET>

Checks whether the output routine should occur; either because the page is full enough, or because the provided penalty is Some (and assumed to be <= -10000) and the page is not empty.
Source§

fn do_output( engine: &mut EngineReferences<'_, ET>, caused_penalty: Option<i32>, ) -> TeXResult<(), ET>

Actually calls the output routine
Source§

fn split_vertical( engine: &mut EngineReferences<'_, ET>, nodes: Vec<VNode<ET>>, target: <ET as EngineTypes>::Dim, ) -> SplitResult<ET>

Split a vertical list for the provided target height
Source§

fn open_paragraph(engine: &mut EngineReferences<'_, ET>, token: ET::Token)

Open a new paragraph; assumed to be called in (internal) vertical mode
Source§

fn close_paragraph(engine: &mut EngineReferences<'_, ET>) -> TeXResult<(), ET>

Close a paragraph; assumed to be called in horizontal mode
Source§

fn split_paragraph( engine: &mut EngineReferences<'_, ET>, specs: Vec<ParLineSpec<ET>>, children: Vec<HNode<ET>>, start_ref: SourceReference<<<ET as EngineTypes>::File as File>::SourceRefID>, ) -> TeXResult<(), ET>

Split a paragraph into lines and add them (as horizontal boxes) to the current vertical list

Auto Trait Implementations§

§

impl<ET> Freeze for DefaultStomach<ET>
where <ET as EngineTypes>::Token: Freeze, <ET as EngineTypes>::Dim: Freeze,

§

impl<ET> !RefUnwindSafe for DefaultStomach<ET>

§

impl<ET> !Send for DefaultStomach<ET>

§

impl<ET> !Sync for DefaultStomach<ET>

§

impl<ET> Unpin for DefaultStomach<ET>
where <ET as EngineTypes>::Token: Unpin, <ET as EngineTypes>::Dim: Unpin, <ET as EngineTypes>::CustomNode: Unpin, <<ET as EngineTypes>::File as File>::SourceRefID: Unpin, <ET as EngineTypes>::Char: Unpin, <ET as EngineTypes>::Font: Unpin, <ET as EngineTypes>::MuDim: Unpin, ET: Unpin,

§

impl<ET> UnsafeUnpin for DefaultStomach<ET>

§

impl<ET> !UnwindSafe for DefaultStomach<ET>

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