Skip to main content

EngineSession

Struct EngineSession 

Source
pub struct EngineSession<'a, P, R, H, F = NoFontSystem> { /* private fields */ }
Expand description

Per fragment execution state cloned from the cached format at session creation.

Implementations§

Source§

impl<P, R, H, F> EngineSession<'_, P, R, H, F>

Source

pub fn layout_fragment(&mut self, input: &str) -> Result<Fragment, EngineError>

Typesets an inline math string and returns an IR fragment.

Source

pub fn layout_fragment_input( &mut self, input: FragmentInput, ) -> Result<Fragment, EngineError>

Typesets the given fragment input and returns an IR fragment.

Source

pub fn generated_engine(&self) -> PortableTexEngine<'_>

Instantiate the generated engine seeded from cached format state.

Source

pub fn load_input(&self, name: &str) -> Result<Resource, ResourceError>

Reads a TeX input file by name from the resource provider.

Source

pub fn load_package(&self, name: &str) -> Result<Resource, ResourceError>

Reads a TeX package by name from the resource provider.

Source

pub fn load_class(&self, name: &str) -> Result<Resource, ResourceError>

Reads a LaTeX document class by name from the resource provider.

Source

pub fn load_font_definition( &self, name: &str, ) -> Result<Resource, ResourceError>

Reads a font definition file by name from the resource provider.

Source

pub fn load_package_support( &self, name: &str, ) -> Result<Resource, ResourceError>

Reads a package support file by name from the resource provider.

Source

pub fn load_font_resource(&self, name: &str) -> Result<Resource, ResourceError>

Reads a font file by name from the resource provider.

Source

pub fn load_encoding(&self, name: &str) -> Result<Resource, ResourceError>

Reads a font encoding file by name from the resource provider.

Source

pub fn load_map(&self, name: &str) -> Result<Resource, ResourceError>

Reads a font map file by name from the resource provider.

Source

pub fn load_config(&self, name: &str) -> Result<Resource, ResourceError>

Reads a TeX configuration resource by name from the resource provider.

Source

pub fn load_asset( &self, package: &str, name: &str, ) -> Result<Resource, ResourceError>

Reads a package asset from the resource provider.

Source

pub fn load_format_image(&self, name: &str) -> Result<Resource, ResourceError>

Reads a format image resource by name from the resource provider.

Source

pub fn load_font(&self, query: &FontQuery) -> Result<FontData, FontError>

Loads a font matching the given query from the engine’s font system.

Source

pub fn shape_text( &self, request: &ShapeRequest<'_>, ) -> Result<ShapedText, FontError>

Shapes a text run via the engine’s font system.

Source

pub fn primitive(&self, name: &str) -> Option<&PrimitiveEntry>

Returns the primitive dispatch entry for a control sequence name.

Source

pub fn semantics(&self) -> &EngineSemantics

Computed semantics for this session.

Source

pub fn ir_emitter(&self) -> IrEmitter

IR emitter seeded with session metadata, defaults to inline math fragment kind.

Source

pub fn ir_emitter_for(&self, kind: FragmentKind) -> IrEmitter

IR emitter seeded with session metadata and the given fragment kind.

Source

pub fn state(&self) -> &SessionState

Session local state cloned from the cached format at session creation.

Source

pub fn state_mut(&mut self) -> &mut SessionState

Mutable access to the session’s local state.

Trait Implementations§

Source§

impl<'a, P: Clone, R: Clone, H: Clone, F: Clone> Clone for EngineSession<'a, P, R, H, F>

Source§

fn clone(&self) -> EngineSession<'a, P, R, H, F>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, P: Debug, R: Debug, H: Debug, F: Debug> Debug for EngineSession<'a, P, R, H, F>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, P, R, H, F = NoFontSystem> !Send for EngineSession<'a, P, R, H, F>

§

impl<'a, P, R, H, F = NoFontSystem> !Sync for EngineSession<'a, P, R, H, F>

§

impl<'a, P, R, H, F> Freeze for EngineSession<'a, P, R, H, F>

§

impl<'a, P, R, H, F> RefUnwindSafe for EngineSession<'a, P, R, H, F>

§

impl<'a, P, R, H, F> Unpin for EngineSession<'a, P, R, H, F>

§

impl<'a, P, R, H, F> UnsafeUnpin for EngineSession<'a, P, R, H, F>

§

impl<'a, P, R, H, F> UnwindSafe for EngineSession<'a, P, R, H, F>

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.

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