#[non_exhaustive]pub struct ConversionReport {
pub plan: Plan,
pub artifacts: Vec<Artifact>,
pub warnings: Vec<Warning>,
pub costs: Vec<StepCost>,
pub attempts: Vec<RouteAttempt>,
pub ignored_params: Vec<String>,
/* private fields */
}Expand description
A resolved conversion: the accepted route, its warnings, and the artifacts.
Artifacts live in a private directory owned by this report. Dropping the
report deletes them, so copy final files out before the report is dropped.
Moving or cloning artifact paths does not transfer workspace ownership.
Use Self::write_all_to to persist artifacts, or Self::directory to
access the workspace directly.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.plan: PlanRoute selected and executed by the converter, or the supplied forced plan.
artifacts: Vec<Artifact>Final artifacts, in adapter output order, or input order for identity copies.
Format labels were checked against the target, not independently decoded,
unless ConversionOptions::verify was enabled for this conversion.
warnings: Vec<Warning>One warning per non-lossless step in this report’s plan.
An empty list is not a guarantee of complete quality or metadata preservation.
costs: Vec<StepCost>Cost-ordered notes for every non-lossless step that actually ran, carrying the adapter-declared fidelity note when the step supplied one.
This is the quality/cost view a UI should render next to warnings: what each lossy step discards, straight from the adapter, rather than the engine’s generic sentence.
attempts: Vec<RouteAttempt>Structured log of every route attempted while producing this report.
Every attempt is included, including earlier fallbacks that failed and
the accepted route (the final entry). Empty only when conversion itself
failed before planning, because a failed Converter::convert returns
Error::RoutesFailed only as a rendered string.
ignored_params: Vec<String>Requested ConversionOptions::params keys no executed step declared support for.
Adapters ignore unknown keys by contract, so a typo would otherwise
silently change nothing. After each successful route the engine unions
crate::Adapter::param_keys over its steps and reports the difference.
A nonempty list is informational: the conversion succeeded, but those
knobs had no effect.
Implementations§
Source§impl ConversionReport
impl ConversionReport
Sourcepub fn directory(&self) -> &Path
pub fn directory(&self) -> &Path
The workspace directory holding this report’s artifacts.
It also contains staged inputs and intermediate outputs. The returned path is valid only while this report’s temporary directory exists; this method does not persist or transfer ownership of that directory.
Sourcepub fn write_all_to(&self, dir: &Path) -> Result<Vec<PathBuf>>
pub fn write_all_to(&self, dir: &Path) -> Result<Vec<PathBuf>>
Copy the final artifacts into dir, creating it when missing.
Files are named from Self::suggested_names and never overwritten: an
existing destination gains a -<n> suffix, matching the collision naming
inside the batch itself. Each file is written through a temporary path
and renamed, so a failed copy leaves no partial output. Returns the
written paths in artifact order. The report keeps ownership of the
workspace; dropping the report does not remove these copies. Calling
this method twice persists a second, rename-deduplicated set.
§Errors
Returns Error::Io for filesystem failures.
Sourcepub fn suggested_names(&self) -> Vec<String>
pub fn suggested_names(&self) -> Vec<String>
Stable artifact file names, converted-<index>.<target>.
The report does not retain input paths, so batch output directories get
positional names; rename after writing if the original basename matters.
Artifacts that carry an Artifact::logical_name instead suggest a
sanitized form of it, preserving the member names extraction produced.