#[non_exhaustive]pub enum Error {
Io(Error),
UnsupportedFormat(String),
UnsupportedOperation(String),
ParseError(String),
MissingDependency {
name: String,
details: String,
},
SidecarFailure {
name: String,
code: Option<i32>,
stderr: String,
},
Other(String),
}Expand description
Errors that can arise during extraction.
The variants are intentionally coarse-grained — a ParseError from
the Pandoc backend and a ParseError from pdfium-render look the
same to the caller, distinguished only by the message string. If
you need fine-grained failure routing, dispatch on
Extractor::name when constructing the
engine, or wrap a backend with your own error mapping.
Marked #[non_exhaustive] so future minor versions can add new
variants (e.g. a dedicated EncryptedDocument for password-
protected PDFs) without breaking downstream match blocks.
Callers that pattern-match should always include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Filesystem failure: file missing, permission denied, EOF, etc.
UnsupportedFormat(String)
The file extension has no registered extractor on this engine.
UnsupportedOperation(String)
A specific extractor doesn’t support the operation (typically
extract_bytes on a backend that only handles file paths).
ParseError(String)
Backend-specific parse failure. The string is the backend’s error message verbatim.
MissingDependency
A required external dependency (Pandoc binary, Tesseract, ONNX
model file) is missing or unusable. name is the dependency
label; details is the underlying error.
Fields
SidecarFailure
A sidecar process exited with a non-zero status. code is the
exit code if known.
Fields
Other(String)
Catch-all for backends that need to surface something the other variants don’t capture.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
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
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