pub enum Error {
Source(SourceError),
Syntax {
offset: u64,
message: &'static str,
},
UnexpectedEof,
Limit(LimitKind),
NoXref,
NoRoot,
MissingObject(ObjId),
WrongType {
expected: &'static str,
found: &'static str,
},
Filter(&'static str),
UnsupportedEncryption(String),
InvalidPassword,
}Expand description
Everything that can go wrong in the syntax layer.
Variants§
Source(SourceError)
The source failed to serve a read.
Syntax
Malformed syntax that could not be (or, in strict mode, was not allowed to be) repaired.
Fields
UnexpectedEof
The input ended inside an object.
Limit(LimitKind)
A resource limit was exceeded.
NoXref
No xref and no objects could be found.
NoRoot
The trailer has no usable /Root.
MissingObject(ObjId)
An object is not in the xref, or cannot be found where it points.
WrongType
An object had a different type than required.
Filter(&'static str)
A stream’s filters failed.
UnsupportedEncryption(String)
The file uses an encryption scheme this library cannot read.
InvalidPassword
Neither the user nor the owner password matched.
Implementations§
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<SourceError> for Error
impl From<SourceError> for Error
Source§fn from(e: SourceError) -> Error
fn from(e: SourceError) -> Error
Converts to this type from the input type.
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more