Skip to main content

Module render

Module render 

Source
Expand description

The serve-side render layer (Phase 12): the shared, versioned LayoutDescriptor serde shape (Plan 01) the offline emitter and the writer-only serve path (Plan 02) both use. The serve-side, WRITER-ONLY render module (Phase 12).

Plan 01 landed the shared, versioned LayoutDescriptor serde shape ([layout]) — the umya-free, zip-free single definition the offline emitter and the serve-time writer share. Plan 02 (this code) adds the writer itself: [render_xlsx] replays a LayoutDescriptor and injects the executor’s already-computed values into a “copy of the workbook, filled in,” producing valid, DETERMINISTIC .xlsx bytes IN MEMORY (no filesystem — Lambda-safe, RESEARCH Pitfall 6).

The writer links rust_xlsxwriter (a WRITER; it pulls the zip deflate container but NO workbook reader — D-01, the single deliberate cross-phase purity-gate relaxation). It is reader-free: just purity-check proves umya/quick-xml stay absent from the served tree while asserting the writer is present.

Determinism (review item 8, T-12-15) is a FIRST-CLASS invariant: the writer pins the workbook’s document properties to a FIXED creation datetime + empty author/metadata so two renders of the same (layout, run) are byte-identical. Plan 03’s regenerate-on-read returns fresh bytes every read and relies on this byte-stability; the invariant is proven HERE (a determinism test) where it is introduced, not deferred.

Re-exports§

pub use layout::*;

Modules§

layout
The shared, versioned LayoutDescriptor/SheetLayout/CellLayout serde shapes (D-05) — the FULL workbook-layout descriptor the bundle’s layout.json member serializes and the writer replays. The shared, versioned LayoutDescriptor serde model (Phase 12, Plan 01).

Enums§

RenderError
A fallible render failure (review item 8 — the writer value path is panic-free; a malformed coordinate / non-finite value / writer error surfaces as an Err, NEVER a panic and NEVER a bogus cell). Owned String detail to match the crate’s LintFinding error style (no borrow across the API).

Functions§

normalize_formula_for_writer
Normalize a captured formula for the rust_xlsxwriter writer (review item 4).
render_xlsx
Render a LayoutDescriptor + the executor’s RunResult into valid, DETERMINISTIC .xlsx bytes IN MEMORY (review item 8, D-01).