Skip to main content

ConversionReport

Struct ConversionReport 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§plan: Plan

Route 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

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for ConversionReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.