pub struct PrintLayoutResult {
pub contract_version: u16,
pub pages: Vec<PageLayout>,
}Expand description
Deterministic page/system geometry for a score.
Fields§
§contract_version: u16§pages: Vec<PageLayout>Implementations§
Source§impl PrintLayoutResult
impl PrintLayoutResult
Sourcepub fn validate(&self) -> Result<(), PrintLayoutError>
pub fn validate(&self) -> Result<(), PrintLayoutError>
Validate page and system addresses before consuming a serialized layout.
Layouts produced by compute_print_layout satisfy this contract. The explicit
validation is useful for hosts that persist or transport PrintLayoutResult values.
Sourcepub fn page(&self, address: PageAddress) -> Option<&PageLayout>
pub fn page(&self, address: PageAddress) -> Option<&PageLayout>
Retrieve one page artifact by its stable address without recomputing layout.
Sourcepub fn export_page_artifacts(
&self,
) -> Result<Vec<PageArtifact>, PrintLayoutError>
pub fn export_page_artifacts( &self, ) -> Result<Vec<PageArtifact>, PrintLayoutError>
Export validated page descriptors for host renderers and archival backends.
The returned vector preserves physical page order. No filesystem, PDF backend, font loader, or renderer-specific object is involved; hosts can serialize or render each descriptor independently. Validation happens before any descriptor is returned.
Sourcepub fn export_page_render_trees(
&self,
score: &Score,
) -> Result<Vec<PageRenderTree>, PrintLayoutError>
pub fn export_page_render_trees( &self, score: &Score, ) -> Result<Vec<PageRenderTree>, PrintLayoutError>
Project this validated pagination and score into page-owned semantic nodes.
Nodes keep canonical score addresses so a host never has to reverse-engineer ownership from SVG groups or page-local indices.
Sourcepub fn export_page_render_trees_for_view(
&self,
score: &Score,
view_id: &str,
) -> Result<Vec<PageRenderTree>, PrintLayoutError>
pub fn export_page_render_trees_for_view( &self, score: &Score, view_id: &str, ) -> Result<Vec<PageRenderTree>, PrintLayoutError>
Export page trees for a linked view without rewriting canonical source addresses.