Skip to main content

PortableTexEngine

Struct PortableTexEngine 

Source
pub struct PortableTexEngine<'resources> { /* private fields */ }

Implementations§

Source§

impl<'resources> PortableTexEngine<'resources>

Source

pub fn from_format<R>(format: &PortableFormatImage, resources: R) -> Self
where R: ResourceProvider + 'resources,

Source

pub fn with_font_platform<F>(self, fonts: F) -> Self
where F: FontPlatform + 'resources,

Source

pub fn with_platform<P>(self, platform: P) -> Self
where P: PortablePlatform + 'resources,

Source

pub fn initialize_format_state(&mut self) -> bool

Runs INITEX initialization, the only entry point that accepts an uninitialized state.

Source

pub fn begin_primary_input(&mut self, name: &str, bytes: Vec<u8>) -> bool

Source

pub fn run_main_control(&mut self) -> bool

Source

pub fn run_format_initialization(&mut self) -> bool

Source

pub fn begin_fragment_capture(&mut self)

Starts capturing a fragment root and drops the previous fragment’s host box records.

Source

pub fn end_fragment_capture(&mut self)

Source

pub fn snapshot_format(&self) -> PortableFormatImage

Source

pub fn into_format(self) -> PortableFormatImage

Seals this engine’s state in place as a format image, avoiding the copy Self::snapshot_format makes.

Source

pub fn finalize_trie(&mut self) -> bool

Packs the hyphenation trie as \dump would, false when it overflows, only once no more \patterns follow.

Source

pub fn resource_request_count(&self) -> usize

Source

pub fn resource_request_records(&self) -> &[PortableResourceRequestRecord]

Source

pub fn transcript_bytes(&self) -> &[u8] ⓘ

Source

pub fn primary_input_source_span(&self) -> Option<PortableSourceSpan>

The first interned span of the primary input, if any.

Source

pub fn stripped_page_build_count(&self) -> usize

Source

pub fn stripped_shipout_count(&self) -> usize

Source

pub fn stripped_special_output_count(&self) -> usize

Source

pub fn stripped_picture_load_count(&self) -> usize

Source

pub fn stripped_source_special_count(&self) -> usize

Source

pub fn stripped_write_whatsit_diagnostic_count(&self) -> usize

Source

pub fn stripped_pdf_extension_count(&self) -> usize

Source

pub fn stripped_page_top_prune_count(&self) -> usize

Source

pub fn last_stripped_shipout_box(&self) -> Option<PortableNodeHandle>

Source

pub fn captured_fragment_root(&self) -> Option<PortableNodeHandle>

Source

pub fn host_box_record(&self, index: usize) -> Option<&PortableHostBox>

Host box render payload by record id, as referenced by HostBoxRef marker nodes.

Source

pub fn font_at_size(&self, font: i32) -> i32

Size in scaled points font number font was loaded at.

Source

pub fn font_name(&self, font: i32) -> Option<String>

The \font name of a font number, the XeTeX spec of a native font or the TFM name.

Source

pub fn native_font_spec(&self, font: i32) -> Option<String>

The spec a native font number was loaded with, from the font platform.

Source

pub fn native_font_key(&self, font: i32) -> Option<u64>

The host font key of a native font number, from the font platform.

Source

pub fn native_font_table(&self) -> Vec<(PortableFontHandle, String, i32)>

The attached font platform’s native font table, packaged with a serialized format image.

Source

pub fn restore_native_font_table( &mut self, table: &[(PortableFontHandle, String, i32)], ) -> bool

Rebinds a loaded image’s native fonts from a Self::native_font_table snapshot, false when one fails.

Source

pub fn last_abort_status(&self) -> Option<i32>

Source

pub fn last_error_message(&self) -> Option<&str>

The message of the last run’s surfaced TeX error, None after a clean run or a bare abort.

Source

pub fn last_error(&self) -> Option<&PortableError>

The last run’s surfaced error with its kind and input position, None after a clean run or a bare abort.

Source

pub fn set_sandbox(&mut self, on: bool)

Switches the fragment sandbox and resets its per run bookkeeping.

Source

pub fn set_sandbox_op_budget(&mut self, budget: u64)

Sets the sandbox work budget, counted in commands, macro calls and expansions per run.

Source

pub fn set_sandbox_wrapper_suffix(&mut self, start: Option<u32>)

Marks where the host wrapper’s suffix starts in the primary input, as a byte offset.

Source

pub fn snapshot_node( &self, handle: PortableNodeHandle, ) -> Option<PortableNodeSnapshot>

Reads one node’s fields, None for a handle outside node memory.

Source

pub fn set_source_tracking(&mut self, on: bool)

Enables or disables source tracking, clearing every table so the calls around it may come in any order.

Source

pub fn source_tracking_enabled(&self) -> bool

Whether source tracking is currently enabled.

Source

pub fn node_enclosing_spans( &self, handle: PortableNodeHandle, ) -> Vec<PortableSourceSpan>

Spans of the constructs strictly enclosing a node, innermost first and in the node’s own source.

Source

pub fn input_source_spans(&self) -> Vec<PortableSourceSpan>

Every interned span in display form.

Auto Trait Implementations§

§

impl<'resources> !RefUnwindSafe for PortableTexEngine<'resources>

§

impl<'resources> !Send for PortableTexEngine<'resources>

§

impl<'resources> !Sync for PortableTexEngine<'resources>

§

impl<'resources> !UnwindSafe for PortableTexEngine<'resources>

§

impl<'resources> Freeze for PortableTexEngine<'resources>

§

impl<'resources> Unpin for PortableTexEngine<'resources>

§

impl<'resources> UnsafeUnpin for PortableTexEngine<'resources>

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.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.