Skip to main content

DigestionAPI

Trait DigestionAPI 

Source
pub trait DigestionAPI {
Show 14 methods // Required methods fn initialize_singletons(&mut self, preloads: Vec<String>) -> Result<()>; fn digest( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, no_init: bool, ) -> Result<Digested>; fn digest_setup( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, ) -> Result<String>; fn digest_file( &mut self, request: String, options: DigestionOptions, ) -> Result<Digested>; fn digest_internal(&mut self) -> Result<Digested>; fn digest_adaptive( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, transition_budget: usize, ) -> Result<AdaptiveOutcome>; fn stream_setup( &mut self, document: &mut Document, budget: usize, ) -> Result<FragmentIndex>; fn stream_pass1( &mut self, document: &mut Document, index: &mut FragmentIndex, seed: Option<Vec<Digested>>, ) -> Result<bool>; fn stream_finish( &mut self, document: Document, index: FragmentIndex, fatal_stop: bool, phase_clock: Instant, ) -> Result<Document>; fn convert_file(&mut self, filepath: String) -> Result<Document>; fn convert_streaming( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, budget: usize, ) -> Result<Document>; fn convert_document(&mut self, digested: Digested) -> Result<Document>; // Provided methods fn load_preamble(&mut self, preamble: String) { ... } fn load_postamble(&mut self, postamble: String) { ... }
}

Required Methods§

Source

fn initialize_singletons(&mut self, preloads: Vec<String>) -> Result<()>

Source

fn digest( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, no_init: bool, ) -> Result<Digested>

Source

fn digest_setup( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, ) -> Result<String>

Source

fn digest_file( &mut self, request: String, options: DigestionOptions, ) -> Result<Digested>

Source

fn digest_internal(&mut self) -> Result<Digested>

Source

fn digest_adaptive( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, transition_budget: usize, ) -> Result<AdaptiveOutcome>

Eager digestion that turns into streaming pass 1 at an RSS-driven yield seam (single pass, bounded memory) instead of restarting from the top; a document that never crosses the spill watermark comes back whole as AdaptiveOutcome::Eager.

Source

fn stream_setup( &mut self, document: &mut Document, budget: usize, ) -> Result<FragmentIndex>

Streaming front half (spill store, deferred root, yield knobs); returns the fragment index. See the Core impl.

Source

fn stream_pass1( &mut self, document: &mut Document, index: &mut FragmentIndex, seed: Option<Vec<Digested>>, ) -> Result<bool>

Streaming pass 1 (digest → absorb → spill at legal seams), optionally seeded with already-digested bodies; returns whether a fatal stopped it.

Source

fn stream_finish( &mut self, document: Document, index: FragmentIndex, fatal_stop: bool, phase_clock: Instant, ) -> Result<Document>

Streaming tail: root hooks, pass 2 over the spilled segments, finalize.

Source

fn convert_file(&mut self, filepath: String) -> Result<Document>

Source

fn convert_streaming( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, budget: usize, ) -> Result<Document>

Streaming (fragmented) conversion: interleaved digest→build with spill-to-disk, a streaming pass 2, and placeholder-spliced assembly. The Perl-parity eager path is digest + convert_document; this is the sanctioned bounded-memory divergence (OXIDIZED_DESIGN), activated only via Config::streaming.

Source

fn convert_document(&mut self, digested: Digested) -> Result<Document>

Provided Methods§

Source

fn load_preamble(&mut self, preamble: String)

Load preamble content. Perl: Core.pm loadPreamble

Source

fn load_postamble(&mut self, postamble: String)

Load postamble content. Perl: Core.pm loadPostamble

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DigestionAPI for Core

Source§

fn digest_setup( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, ) -> Result<String>

The input-side half of DigestionAPI::digest: canonicalize the request, seed SOURCEFILE/SOURCEDIRECTORY/SEARCHPATHS/\jobname, queue postamble/source/preamble on the gullet. Returns the progress-note label the caller must note_end when digestion completes. Shared by the eager path and convert_streaming (which drives digestion itself, fragment-by-fragment).

Source§

fn stream_setup( &mut self, document: &mut Document, budget: usize, ) -> Result<FragmentIndex>

The streaming front half: spill store + disk gate, deferred root, literal placeholders, flat spill, the fragment index and the yield knobs. Shared by convert_streaming and the adaptive transition.

Source§

fn stream_pass1( &mut self, document: &mut Document, index: &mut FragmentIndex, seed: Option<Vec<Digested>>, ) -> Result<bool>

Streaming pass 1: interleaved digest → absorb → spill, at legal seams only. seed = bodies already digested by the eager loop (the adaptive transition), absorbed as fragment 1. Returns whether a fatal stopped it.

Source§

fn stream_finish( &mut self, document: Document, index: FragmentIndex, fatal_stop: bool, phase_clock: Instant, ) -> Result<Document>

Streaming tail: root hooks, pass 2 over the spilled segments, finalize.

Source§

fn convert_document(&mut self, digested: Digested) -> Result<Document>

Restriction: convert_document runs on a single thread, and should never try branching out.

Source§

fn digest_file( &mut self, request: String, options: DigestionOptions, ) -> Result<Digested>

Restriction: digest_file runs on a single thread, and should never try branching out.

Source§

fn initialize_singletons(&mut self, preloads: Vec<String>) -> Result<()>

Source§

fn digest( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, _no_init: bool, ) -> Result<Digested>

Source§

fn convert_file(&mut self, filepath: String) -> Result<Document>

Source§

fn convert_streaming( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, budget: usize, ) -> Result<Document>

Source§

fn digest_adaptive( &mut self, request: String, preamble: Option<String>, postamble: Option<String>, mode: Option<DigestionMode>, transition_budget: usize, ) -> Result<AdaptiveOutcome>

Source§

fn digest_internal(&mut self) -> Result<Digested>

Implementors§