#[non_exhaustive]pub enum PdfRepair {
XrefEntriesPadded,
StreamLength {
object: (u32, u16),
offset: usize,
declared: Option<i64>,
recovered: Option<usize>,
},
}Expand description
One repair the reader makes (or has to give up on) to read the file.
Serialized (serve, Node, Python) as an object tagged by kind:
{"kind": "stream_length", "object": [4, 0], "offset": 202, "declared": 5, "recovered": 3}, {"kind": "xref_entries_padded"}.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
XrefEntriesPadded
lopdf rejects the file, and it loads once the classic cross-reference table’s 19-byte entries (a bare LF where the spec wants a two-byte EOL) are padded to 20 — the reader’s fallback for parsers that refuse them (lopdf 0.45 itself reads such entries as they are; then no repair is taken and none is reported).
StreamLength
A stream whose declared /Length does not end at its endstream.
Trait Implementations§
impl Eq for PdfRepair
Source§impl Serialize for PdfRepair
impl Serialize for PdfRepair
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PdfRepair
Auto Trait Implementations§
impl Forget for PdfRepair
impl Freeze for PdfRepair
impl RefUnwindSafe for PdfRepair
impl Send for PdfRepair
impl Sync for PdfRepair
impl Unpin for PdfRepair
impl UnsafeUnpin for PdfRepair
impl UnwindSafe for PdfRepair
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more