#[non_exhaustive]pub enum LoadError {
NotPdf,
WrongPassword,
UnsupportedEncryption(String),
Broken(String),
Limit(LimitExceeded),
}Expand description
Why a document could not be opened.
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.
NotPdf
No %PDF header within the first kilobyte, or a file too short to
hold one.
WrongPassword
The document is encrypted and the password given does not open it. Distinct from the others because callers ask again rather than give up.
UnsupportedEncryption(String)
The document uses a security handler this reader does not implement.
Broken(String)
The file is damaged past what recovery could repair: no usable cross-reference information, or no catalog with pages in it.
Limit(LimitExceeded)
The caller’s Limits::deadline had passed when the open began, or
passed during the cross-reference rebuild scan.
Trait Implementations§
impl Eq for LoadError
Source§impl Error for LoadError
impl Error for LoadError
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()
impl StructuralPartialEq for LoadError
Auto Trait Implementations§
impl Freeze for LoadError
impl RefUnwindSafe for LoadError
impl Send for LoadError
impl Sync for LoadError
impl Unpin for LoadError
impl UnsafeUnpin for LoadError
impl UnwindSafe for LoadError
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