Solve one concrete task
Inspect build reports
Use the returned build report to see which routes and assets were emitted, skipped, restored, or removed.
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
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.
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.