pub struct Conversion {
pub level: Level,
pub compromises: Vec<Compromise>,
pub refusals: Vec<Refusal>,
}Expand description
What a conversion produced, and what it cost.
Returned by the facade’s Document::to_pdfa whether or not the conversion
succeeded: Conversion::refusals non-empty means no bytes were written
and the file is unchanged, and an empty refusals with a non-empty
Conversion::compromises means a file was written that is not the
document that went in.
The three states are distinguishable without inspecting the byte count,
which is the point — see Conversion::converted.
Fields§
§level: LevelThe level converted to.
compromises: Vec<Compromise>Everything the conversion did that changed the document’s meaning, in the order the pipeline did it.
Empty means the conversion was faithful: the file that came out draws what the file that went in drew.
refusals: Vec<Refusal>Every compromise the policy did not authorize.
Non-empty means nothing was written. The conversion collects all of them rather than stopping at the first, so a caller can widen the policy once instead of discovering the obstacles one run at a time.
Implementations§
Source§impl Conversion
impl Conversion
Sourcepub fn converted(&self) -> bool
pub fn converted(&self) -> bool
Whether a file was written.
False exactly when Conversion::refusals is non-empty.
Sourcepub fn rasterized_pages(&self) -> Vec<u32>
pub fn rasterized_pages(&self) -> Vec<u32>
The pages that were rendered to images, in page order.
The one compromise whose extent a caller almost always wants separately from the list, because it is the one that changes what a page fundamentally is.
Trait Implementations§
Source§impl Clone for Conversion
impl Clone for Conversion
Source§fn clone(&self) -> Conversion
fn clone(&self) -> Conversion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more