pub enum ExtractError {
UnsupportedFormat(String),
Encrypted(String),
Parse {
format: &'static str,
message: String,
},
Io(Error),
}Expand description
Errors from document extraction. Every variant is a typed refusal the CLI maps to a stable machine code — extraction never panics on a bad or encrypted input.
Variants§
UnsupportedFormat(String)
The file extension is missing or not one of the supported document
formats. Carries the offending extension (or "" when absent).
Encrypted(String)
The document is encrypted/password-protected and could not be opened without a password (or with the wrong one). A clean refusal — the extractor must never emit partial/garbled bytes for a locked file.
Parse
A format adapter failed to parse a structurally invalid or corrupt document. Carries the adapter’s diagnostic.
Fields
Io(Error)
An underlying I/O failure (file missing, unreadable, etc.).
Implementations§
Trait Implementations§
Source§impl Debug for ExtractError
impl Debug for ExtractError
Source§impl Display for ExtractError
impl Display for ExtractError
Source§impl Error for ExtractError
impl Error for ExtractError
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()
Auto Trait Implementations§
impl Freeze for ExtractError
impl !RefUnwindSafe for ExtractError
impl Send for ExtractError
impl Sync for ExtractError
impl Unpin for ExtractError
impl UnsafeUnpin for ExtractError
impl !UnwindSafe for ExtractError
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