pub enum Error {
Show 31 variants
Unimplemented(&'static str),
ObjectType {
expected: &'static str,
found: &'static str,
},
DictType {
expected: &'static str,
found: String,
},
AlreadyEncrypted,
CharacterEncoding,
Decompress(DecompressError),
Parse(ParseError),
Decryption(DecryptionError),
DictKey(String),
InvalidInlineImage(String),
InvalidOutline(String),
InvalidStream(String),
InvalidObjectStream(String),
InvalidOffset(usize),
IO(Error),
NoOutline,
NotEncrypted,
MissingXrefEntry,
ObjectNotFound(ObjectId),
ReferenceCycle(ObjectId),
PageNumberNotFound(u32),
NumericCast(String),
ReferenceLimit,
TextStringDecode,
Xref(XrefError),
IndirectObject {
offset: usize,
},
ObjectIdMismatch,
Syntax(String),
ToUnicodeCMap(UnicodeCMapError),
TryFromInt(TryFromIntError),
UnsupportedSecurityHandler(Vec<u8>),
}
Variants§
Unimplemented(&'static str)
Lopdf does not (yet) implement a needed feature.
ObjectType
An Object has the wrong type, e.g. the Object is an Array where a Name would be expected.
DictType
AlreadyEncrypted
PDF document is already encrypted.
CharacterEncoding
The encountered character encoding is invalid.
Decompress(DecompressError)
The stream couldn’t be decompressed.
Parse(ParseError)
Failed to parse input.
Decryption(DecryptionError)
Error when decrypting the contents of the file
DictKey(String)
Dictionary key was not found.
InvalidInlineImage(String)
Invalid inline image.
InvalidOutline(String)
Invalid document outline.
InvalidStream(String)
Invalid stream.
InvalidObjectStream(String)
Invalid object stream.
InvalidOffset(usize)
Byte offset in stream or file is invalid.
IO(Error)
IO error
NoOutline
PDF document has no outline.
NotEncrypted
PDF document is not encrypted.
MissingXrefEntry
Missing xref entry.
ObjectNotFound(ObjectId)
The Object ID was not found.
ReferenceCycle(ObjectId)
Dereferencing object failed due to a reference cycle.
PageNumberNotFound(u32)
Page number was not found in document.
NumericCast(String)
Numeric type cast failed.
ReferenceLimit
Dereferencing object reached the limit. This might indicate a reference loop.
TextStringDecode
Decoding text string failed.
Xref(XrefError)
Error while parsing cross reference table.
IndirectObject
Invalid indirect object while parsing at offset.
ObjectIdMismatch
Found object ID does not match expected object ID.
Syntax(String)
Syntax error while processing the content stream.
ToUnicodeCMap(UnicodeCMapError)
Could not parse ToUnicodeCMap.
TryFromInt(TryFromIntError)
UnsupportedSecurityHandler(Vec<u8>)
Encountered an unsupported security handler.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DecryptionError> for Error
impl From<DecryptionError> for Error
Source§fn from(source: DecryptionError) -> Self
fn from(source: DecryptionError) -> Self
Source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
Source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
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>
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>
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