Skip to main content

SaveReport

Struct SaveReport 

Source
#[non_exhaustive]
pub struct SaveReport { pub bytes_written: usize, pub bytes_appended: usize, pub objects_written: usize, pub objects_verbatim: usize, pub objects_reserialized: usize, pub byte_identical: bool, pub delinearized: bool, pub promoted: Vec<ObjId>, pub objects_deleted: usize, pub rc4_keystream_reused: Option<usize>, }
Expand description

What a save actually did — the honest report the CLI, the GUI and the corpus harness all print.

Counters exist for the things that would otherwise be invisible: a save that quietly promoted objects out of an object stream, or that spent a document’s Fast Web View property, has changed something the operator cares about and must say so (“fuzzy, never sneaky”).

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.
§bytes_written: usize

Total bytes in the produced file.

§bytes_appended: usize

Bytes appended past the base file’s original length. Exactly 0 for an empty-dirty-set incremental save, and equal to SaveReport::bytes_written for a full rewrite.

§objects_written: usize

Number of object definitions emitted in this save.

§objects_verbatim: usize

Objects re-emitted verbatim from their retained source bytes — the §5 invariant’s numerator.

§objects_reserialized: usize

Objects that had to be re-serialized from values because they had no file-level bytes (compressed in an object stream) or because a policy deliberately rewrote them (/Producer).

Every one of these is a byte-level divergence from the input, and each is counted rather than rounded away (R20-style).

§byte_identical: bool

Whether the output is byte-identical to the input. Only ever true for an empty-dirty-set save_incremental.

§delinearized: bool

Whether this save spent the input’s live Fast Web View property (Annex F.1; R36). Reported, never repaired.

§promoted: Vec<ObjId>

Objects that were promoted out of an object stream (R38) — counted and named, per decision 007 W3’s mitigation.

A compressed object cannot be written in place, so touching one moves it to file level. That is a representation change to an object whose value the operator may not have edited at all (an identity re-emission promotes too), and it leaves the old value behind inside the untouched container — see this module’s “Promotion, and the stale copy it leaves”. Both facts are things an operator can act on, so neither is rounded away.

promoted.len() is the count; there is deliberately no separate counter field to fall out of step with the list.

§objects_deleted: usize

Objects given a type-0 (free) cross-reference entry by this save — the Pass 3.2 deletion path (§7.5.4, decision 007 W9).

Counted rather than named, unlike SaveReport::promoted, because a deletion is something the operator asked for and already knows about, whereas a promotion is a representation change pdfcer made on its own initiative. The honesty obligation differs accordingly.

§rc4_keystream_reused: Option<usize>

Some(n) when this save appended under an RC4 handler (Rc4Append::Preserve): n edited objects were re-encrypted under the number and generation, and so the RC4 keystream, of their previous revision. XOR-ing the two ciphertexts cancels the keystream. None for every other save.

Trait Implementations§

Source§

impl Clone for SaveReport

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SaveReport

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for SaveReport

Source§

impl PartialEq for SaveReport

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SaveReport

Auto Trait Implementations§

§

impl Forget for SaveReport

§

impl Freeze for SaveReport

§

impl Move for SaveReport

§

impl RefUnwindSafe for SaveReport

§

impl Send for SaveReport
where RawVecInner: Send,

§

impl Sync for SaveReport
where RawVecInner: Sync,

§

impl Unpin for SaveReport
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for SaveReport

§

impl UnwindSafe for SaveReport
where RawVecInner: UnwindSafe,

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.