pub trait TeXEngine: Sized {
type Types: EngineTypes;
// Required method
fn get_engine_refs(&mut self) -> EngineReferences<'_, Self::Types>;
// Provided methods
fn init_file(&mut self, s: &str) -> TeXResult<(), Self::Types> { ... }
fn run<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>(
&mut self,
f: F,
) -> TeXResult<(), Self::Types> { ... }
fn do_file_default<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>(
&mut self,
s: &str,
f: F,
) -> TeXResult<(), Self::Types> { ... }
fn initialize_tex_primitives(&mut self) { ... }
fn initialize_plain_tex(&mut self) -> TeXResult<(), Self::Types> { ... }
fn initialize_etex_primitives(&mut self) { ... }
fn initialize_eplain_tex(&mut self) -> TeXResult<(), Self::Types> { ... }
fn load_latex(&mut self) -> TeXResult<(), Self::Types> { ... }
}
Expand description
A TeXEngine
combines all necessary components (see EngineTypes
) to compile a TeX file into some output format.
Required Associated Types§
type Types: EngineTypes
Required Methods§
Sourcefn get_engine_refs(&mut self) -> EngineReferences<'_, Self::Types>
fn get_engine_refs(&mut self) -> EngineReferences<'_, Self::Types>
Returns mutable references to the components of the engine.
Provided Methods§
Sourcefn init_file(&mut self, s: &str) -> TeXResult<(), Self::Types>
fn init_file(&mut self, s: &str) -> TeXResult<(), Self::Types>
Initializes the engine with a file, e.g. latex.ltx
or pdftex.cfg
.
§Errors
On TeX errors in init files
Sourcefn run<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>(
&mut self,
f: F,
) -> TeXResult<(), Self::Types>
fn run<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>( &mut self, f: F, ) -> TeXResult<(), Self::Types>
§Errors
On TeX errors in init files
Sourcefn do_file_default<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>(
&mut self,
s: &str,
f: F,
) -> TeXResult<(), Self::Types>
fn do_file_default<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>( &mut self, s: &str, f: F, ) -> TeXResult<(), Self::Types>
Compile a .tex
file. All finished pages are passed to the provided continuation.
§Errors
On TeX errors
Sourcefn initialize_tex_primitives(&mut self)
fn initialize_tex_primitives(&mut self)
Registers all primitives of plain TeX and sets the default variables.
Sourcefn initialize_plain_tex(&mut self) -> TeXResult<(), Self::Types>
fn initialize_plain_tex(&mut self) -> TeXResult<(), Self::Types>
Sourcefn initialize_etex_primitives(&mut self)
fn initialize_etex_primitives(&mut self)
Registers all primitives of plain TeX, e-TeX and sets the default variables.
Sourcefn initialize_eplain_tex(&mut self) -> TeXResult<(), Self::Types>
fn initialize_eplain_tex(&mut self) -> TeXResult<(), Self::Types>
Sourcefn load_latex(&mut self) -> TeXResult<(), Self::Types>
fn load_latex(&mut self) -> TeXResult<(), Self::Types>
Initialized the engine by processing latex.ltx
. Only call this (for modern LaTeX setups)
after calling initialize_etex_primitives
first.
§Errors
On TeX errors
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.