Skip to main content

Converter

Struct Converter 

Source
pub struct Converter { /* private fields */ }

Implementations§

Source§

impl Converter

Source

pub fn from_config(opts: Config) -> Converter

Source

pub fn initialize_session(&mut self) -> Result<()>

Source

pub fn bind_log(&mut self)

Source

pub fn flush_log(&mut self) -> String

Source

pub fn convert(self, source: String) -> ConversionResponse

Source

pub fn convert_content_with_provenance( self, name: &str, content: String, ) -> ConversionResponse

Convert in-memory content under the source name name, producing the HTML5-format core XML (the persistent server then post-processes it). Unlike Converter::convert (literal: → anonymous source), the source is named, so --source-map stamps its locators. Focused on the Document/HTML5 path the server uses — no amble wrapping, no TeX/Box output formats.

Source

pub fn prepare_session<'preplifetime>( &'preplifetime mut self, _opts: &'preplifetime Config, ) -> Result<()>

Source

pub fn digest_content_with_provenance( &mut self, name: &str, content: String, ) -> Result<Digested>

Digest in-memory content as the main document named name, leaving the thread-local engine state live. Used by the persistent server to warm a preamble once (then resume body digestion in a fork child over the inherited state) and by Converter::convert_content_with_provenance for the in-process path.

This is the in-memory twin of crate::core_interface::DigestionAPI::digest_file: same top-level spine — establish the source context, open the source, digest_internal — but the content is supplied rather than read from disk. It shares core_interface::establish_source_context with digest_file (so SOURCEFILE/SOURCEDIRECTORY/SEARCHPATHS/ GRAPHICSPATHS/\jobname can’t drift), making sibling \usepackage/\input/\includegraphics of local files resolve. The source is opened as a named mouth (not the anonymous literal: protocol) so locators carry name — the provenance that --source-map needs (stamp_source_locator only stamps .tex/.ltx/.bbl/.bib user sources). Initializes the session if needed; does not finalize a document.

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.