Skip to main content

CompiledDocument

Struct CompiledDocument 

Source
pub struct CompiledDocument { /* private fields */ }
Expand description

Immutable output of the HTML/CSS frontend, binding compiler, and layout pipeline.

A compiled document owns the fixed-point display commands and every linker resource required to render them. It can therefore be linked repeatedly, or from multiple threads, without reparsing HTML/CSS or rebuilding layout. Text markers written as {{slot_name}} can also be lowered either to fixed-geometry paint bindings or to a parsed-DOM reflow program. The reflow program reuses one worker-local DOM plus the compiled CSS context while rerunning the shaping, layout, and pagination stages required by size-changing values.

Implementations§

Source§

impl CompiledDocument

Source

pub fn page_count(&self) -> usize

Source

pub fn command_count(&self) -> usize

Source

pub fn compile_time_ms(&self) -> f64

Source

pub fn binding_slots(&self) -> &[String]

Source

pub fn binding_program_page_count(&self) -> usize

Source

pub fn binding_program_command_count(&self) -> usize

Source

pub fn reflow_binding_slots(&self) -> &[String]

Source

pub fn reflow_program_node_count(&self) -> usize

Source

pub fn reflow_program_binding_text_node_count(&self) -> usize

Source

pub fn reflow_program_html_binding_node_count(&self) -> usize

Source

pub fn reflow_program_ready(&self) -> bool

Source

pub fn render_to_buffer(&self) -> Result<Vec<u8>, FullBleedError>

Source

pub fn render_to_writer<W: Write>( &self, writer: &mut W, ) -> Result<usize, FullBleedError>

Source

pub fn render_to_file( &self, path: impl AsRef<Path>, ) -> Result<usize, FullBleedError>

Source

pub fn render_many_to_buffer( &self, copies: usize, ) -> Result<Vec<u8>, FullBleedError>

Link copies of the compiled document into one ordered PDF without cloning the display command tree. For a one-page document this is the compiled pages-per-second lane.

Source

pub fn render_many_to_writer<W: Write>( &self, copies: usize, writer: &mut W, ) -> Result<usize, FullBleedError>

Source

pub fn render_bindings_to_buffer( &self, bindings: &HashMap<String, Vec<String>>, ) -> Result<Vec<u8>, FullBleedError>

Execute page-local, fixed-geometry text slots over a columnar record batch.

Static page paint is linked once. Each record receives a distinct, uncompressed text overlay stream, so values vary without reparsing HTML or rerunning layout.

Source

pub fn render_bindings_to_buffer_cancellable( &self, bindings: &HashMap<String, Vec<String>>, cancellation: &AuthoringCancellationToken, ) -> Result<Vec<u8>, FullBleedError>

Execute fixed-geometry bindings with cooperative row-boundary cancellation.

Source

pub fn render_bindings_to_writer<W: Write>( &self, bindings: &HashMap<String, Vec<String>>, writer: &mut W, ) -> Result<usize, FullBleedError>

Source

pub fn render_bindings_to_file( &self, bindings: &HashMap<String, Vec<String>>, path: impl AsRef<Path>, ) -> Result<usize, FullBleedError>

Source

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

Source

pub fn render_reflow_bindings_to_buffer( &self, bindings: &HashMap<String, Vec<String>>, ) -> Result<Vec<u8>, FullBleedError>

Execute size-changing text slots through shaping, layout, and pagination.

HTML tokenization, tree recovery, binding discovery, CSS parsing, and selector compilation are compile-time work. Each worker materializes one private DOM, mutates its bound text nodes per record, and emits completed documents to the ordered streaming PDF linker.

Source

pub fn render_reflow_bindings_to_buffer_with_options( &self, bindings: &HashMap<String, Vec<String>>, options: CompiledReflowOptions, ) -> Result<Vec<u8>, FullBleedError>

Execute compiled content reflow with explicit per-job options.

Source

pub fn render_reflow_bindings_to_buffer_with_options_cancellable( &self, bindings: &HashMap<String, Vec<String>>, options: CompiledReflowOptions, cancellation: &AuthoringCancellationToken, ) -> Result<Vec<u8>, FullBleedError>

Execute compiled reflow with explicit options and cooperative cancellation.

Source

pub fn render_reflow_bindings_to_writer<W: Write>( &self, bindings: &HashMap<String, Vec<String>>, writer: &mut W, ) -> Result<usize, FullBleedError>

Source

pub fn render_reflow_bindings_to_writer_with_options<W: Write>( &self, bindings: &HashMap<String, Vec<String>>, writer: &mut W, options: CompiledReflowOptions, ) -> Result<usize, FullBleedError>

Source

pub fn render_reflow_bindings_to_file( &self, bindings: &HashMap<String, Vec<String>>, path: impl AsRef<Path>, ) -> Result<usize, FullBleedError>

Source

pub fn render_reflow_bindings_to_file_with_options( &self, bindings: &HashMap<String, Vec<String>>, path: impl AsRef<Path>, options: CompiledReflowOptions, ) -> Result<usize, FullBleedError>

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