Rendro.Artifact (Rendro v0.2.0)

Copy Markdown View Source

A pure data carrier containing the rendered PDF bytes, a deterministic hash, and structured diagnostics from the render pipeline.

This is the primary boundary struct for async and ecosystem operations.

Summary

Functions

Creates a new Artifact from the generated binary and the final Document. Hashes the binary using SHA-256 for deterministic caching and verification.

Wraps a transformed binary in a new artifact while preserving diagnostics and merging metadata from the source artifact.

Types

t()

@type t() :: %Rendro.Artifact{
  binary: binary(),
  diagnostics: [map()],
  hash: String.t(),
  metadata: map()
}

Functions

new(pdf_binary, doc, base_metadata \\ %{})

@spec new(binary(), Rendro.Document.t(), map()) :: t()

Creates a new Artifact from the generated binary and the final Document. Hashes the binary using SHA-256 for deterministic caching and verification.

wrap(pdf_binary, source, metadata_updates \\ %{})

@spec wrap(binary(), t(), map()) :: t()

Wraps a transformed binary in a new artifact while preserving diagnostics and merging metadata from the source artifact.