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
impl CompiledDocument
pub fn page_count(&self) -> usize
pub fn command_count(&self) -> usize
pub fn compile_time_ms(&self) -> f64
pub fn binding_slots(&self) -> &[String]
pub fn binding_program_page_count(&self) -> usize
pub fn binding_program_command_count(&self) -> usize
pub fn reflow_binding_slots(&self) -> &[String]
pub fn reflow_program_node_count(&self) -> usize
pub fn reflow_program_binding_text_node_count(&self) -> usize
pub fn reflow_program_html_binding_node_count(&self) -> usize
pub fn reflow_program_ready(&self) -> bool
pub fn render_to_buffer(&self) -> Result<Vec<u8>, FullBleedError>
pub fn render_to_writer<W: Write>( &self, writer: &mut W, ) -> Result<usize, FullBleedError>
pub fn render_to_file( &self, path: impl AsRef<Path>, ) -> Result<usize, FullBleedError>
Sourcepub fn render_many_to_buffer(
&self,
copies: usize,
) -> Result<Vec<u8>, FullBleedError>
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.
pub fn render_many_to_writer<W: Write>( &self, copies: usize, writer: &mut W, ) -> Result<usize, FullBleedError>
Sourcepub fn render_bindings_to_buffer(
&self,
bindings: &HashMap<String, Vec<String>>,
) -> Result<Vec<u8>, FullBleedError>
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.
Sourcepub fn render_bindings_to_buffer_cancellable(
&self,
bindings: &HashMap<String, Vec<String>>,
cancellation: &AuthoringCancellationToken,
) -> Result<Vec<u8>, FullBleedError>
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.
pub fn render_bindings_to_writer<W: Write>( &self, bindings: &HashMap<String, Vec<String>>, writer: &mut W, ) -> Result<usize, FullBleedError>
pub fn render_bindings_to_file( &self, bindings: &HashMap<String, Vec<String>>, path: impl AsRef<Path>, ) -> Result<usize, FullBleedError>
pub fn reflow_program_error(&self) -> Option<&str>
Sourcepub fn render_reflow_bindings_to_buffer(
&self,
bindings: &HashMap<String, Vec<String>>,
) -> Result<Vec<u8>, FullBleedError>
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.
Sourcepub fn render_reflow_bindings_to_buffer_with_options(
&self,
bindings: &HashMap<String, Vec<String>>,
options: CompiledReflowOptions,
) -> Result<Vec<u8>, FullBleedError>
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.
Sourcepub fn render_reflow_bindings_to_buffer_with_options_cancellable(
&self,
bindings: &HashMap<String, Vec<String>>,
options: CompiledReflowOptions,
cancellation: &AuthoringCancellationToken,
) -> Result<Vec<u8>, FullBleedError>
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.