Solve one concrete task
Inspect build reports
Use the returned build report to see which routes and assets were emitted, skipped, restored, removed, or degraded with warnings.
Inspect what a build actually did
Site::render_to(...) returns a BuildReport.
That is useful when you want more than "the build succeeded":
a custom CLI can print a summary
a test can assert that a change only rebuilt one route
a deployment step can decide whether any public assets changed
a CI check can surface non-fatal degraded asset behavior before it ships
Capture the build report
let report = site.render_to("dist")?;
println!(
"built {} route(s), skipped {}, asset operation(s) {}",
report.emitted(),
report.skipped(),
report.asset_operations(),
);
The aggregate helpers are intentionally small:
emitted()skipped()asset_operations()
Inspect per-route outcomes
Each route produces one RouteBuildRecord:
for route in &report.routes {
match &route.status {
RouteBuildStatus::Emitted(reason) => {
println!("built {} -> {} ({reason})", route.route_path, route.output_path);
}
RouteBuildStatus::Skipped => {
println!("skipped {} -> {}", route.route_path, route.output_path);
}
}
}
The current BuildReason values explain why a route was rebuilt:
new route
missing output
program changed
handler changed
output path changed
dependency changed
route manifest changed
Inspect per-asset outcomes
Generated public assets are tracked separately:
for asset in &report.assets {
println!(
"{} -> {} ({})",
asset.source_path,
asset.public_path,
asset.status,
);
}
The current asset statuses are:
TransformedReusedCachedObjectRestoredPublicCopy
This is especially useful when route rendering was skipped but the build still had to restore
missing files under dist/assets/ from the object cache.
Inspect non-fatal warnings
Warnings capture degraded outcomes that were still safe enough to keep the build going.
for warning in &report.warnings {
match warning {
BuildWarning::Asset(warning) => {
println!(
"warning {}: {} ({})",
warning.code,
warning.message,
warning.public_path,
);
if let Some(source_document) = &warning.source_document {
println!(" from {}", source_document);
}
if let Some(reference) = &warning.authored_reference {
println!(" authored as {}", reference);
}
}
}
}
Current adaptive-HDR examples include:
preserving the HDR base image while skipping automatic AVIF gain-map derivation
downgrading a requested HDR JPEG output to a plain SDR JPEG when adaptive-HDR packaging cannot be preserved safely
Track removed outputs
If a route disappears, the build report tells you which outputs were removed:
for path in &report.removed_outputs {
println!("removed {}", path);
}
That makes it practical to test route-family churn without inspecting the filesystem manually.