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>
impl<ET: EngineTypes> Stomach<ET> for DefaultStomach<ET>
Source§fn afterassignment(&mut self) -> &mut Option<ET::Token>
fn afterassignment(&mut self) -> &mut Option<ET::Token>
Mutable reference to the current
\afterassignment Token.Source§fn data_mut(&mut self) -> &mut StomachData<ET>
fn data_mut(&mut self) -> &mut StomachData<ET>
The current list(s)
Source§fn every_top(engine: &mut EngineReferences<'_, ET>)
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>
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>
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>
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 necessarySource§fn assign_font(
engine: &mut EngineReferences<'_, ET>,
_token: ET::Token,
f: ET::Font,
global: bool,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_int_register(
engine: &mut EngineReferences<'_, ET>,
register: usize,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_dim_register(
engine: &mut EngineReferences<'_, ET>,
register: usize,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_skip_register(
engine: &mut EngineReferences<'_, ET>,
register: usize,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_muskip_register(
engine: &mut EngineReferences<'_, ET>,
register: usize,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_toks_register(
engine: &mut EngineReferences<'_, ET>,
token: ET::Token,
register: usize,
global: bool,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_primitive_toks(
engine: &mut EngineReferences<'_, ET>,
token: ET::Token,
name: PrimitiveIdentifier,
global: bool,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_primitive_int(
engine: &mut EngineReferences<'_, ET>,
name: PrimitiveIdentifier,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_primitive_dim(
engine: &mut EngineReferences<'_, ET>,
name: PrimitiveIdentifier,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_primitive_skip(
engine: &mut EngineReferences<'_, ET>,
name: PrimitiveIdentifier,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§fn assign_primitive_muskip(
engine: &mut EngineReferences<'_, ET>,
name: PrimitiveIdentifier,
global: bool,
in_token: ET::Token,
) -> TeXResult<(), ET>
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 necessarySource§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>
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>
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>
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 CommandCodeSource§fn do_defed_char(
engine: &mut EngineReferences<'_, ET>,
token: ET::Token,
char: ET::Char,
) -> TeXResult<(), ET>
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 CommandCodefn 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>,
)
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>
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 listSource§fn maybe_switch_mode(
engine: &mut EngineReferences<'_, ET>,
scope: CommandScope,
token: ET::Token,
name: PrimitiveIdentifier,
) -> TeXResult<bool, ET>
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,
)
fn open_align( engine: &mut EngineReferences<'_, ET>, _inner: BoxType, between: BoxType, )
Opens an
\halign or \valignSource§fn close_align(engine: &mut EngineReferences<'_, ET>) -> TeXResult<(), ET>
fn close_align(engine: &mut EngineReferences<'_, ET>) -> TeXResult<(), ET>
Closes an
\halign or \valignSource§fn add_node_m(
engine: &mut EngineReferences<'_, ET>,
node: MathNode<ET, UnresolvedMathFontStyle<ET>>,
)
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>)
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>
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>
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>
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>
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)
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>
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>
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>
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> 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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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