pub enum EngineError {
InvalidPdf(String),
PageOutOfRange {
index: usize,
count: usize,
},
RenderError(String),
Io(Error),
Encrypted(String),
InvalidPageGeometry {
width: f32,
height: f32,
reason: String,
},
XfaFlattenFailed(String),
LimitExceeded(LimitError),
}Expand description
Errors that can occur in the rendering engine.
Variants§
InvalidPdf(String)
The PDF data is invalid or could not be parsed.
PageOutOfRange
A page index is out of range.
RenderError(String)
A rendering error occurred.
Io(Error)
An I/O error occurred.
Encrypted(String)
The PDF is encrypted and requires a password to open.
InvalidPageGeometry
The page has invalid or degenerate dimensions.
Fields
XfaFlattenFailed(String)
XFA flattening failed.
LimitExceeded(LimitError)
A configured resource limit was exceeded during rendering or
text extraction. Carries the LimitError so callers can
branch on the specific cap that fired.
Implementations§
Source§impl EngineError
impl EngineError
Sourcepub fn ocr_message(&self) -> Option<String>
pub fn ocr_message(&self) -> Option<String>
If this error is an OCR failure carried as EngineError::Io, the
failure’s message.
OCR failures ride as I/O errors because this enum is exhaustive in
1.0.0 and a new variant would break semver: engine-construction
failures carry the typed pdf_ocr::TesseractCliError, everything else
an OcrError, both via [std::io::Error::other]. Callers that need
the typed cause downcast std::io::Error::get_ref; callers that only
need the message read it here. An OS error, and any other variant,
reads as None.
Source§impl EngineError
impl EngineError
Sourcepub fn options(&self) -> Option<&OptionsError>
pub fn options(&self) -> Option<&OptionsError>
The OptionsError carried by this error, if any.
An additive inherent method, so adding it is semver-safe. Callers
that used to match EngineError::ConflictingPageSelection check this
first, before whatever they do with a plain EngineError::Io.
Sourcepub fn model_error(&self) -> Option<&ModelError>
pub fn model_error(&self) -> Option<&ModelError>
The ModelError carried by this error, if
any (#641).
Model failures ride as EngineError::Io because this enum is
exhaustive in 1.0.0 and a new variant would break semver; this walks
the chain back to the typed cause, on every build. Branch on
ModelErrorKind::code.
Trait Implementations§
Source§impl Debug for EngineError
impl Debug for EngineError
Source§impl Display for EngineError
impl Display for EngineError
Source§impl Error for EngineError
impl Error for EngineError
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()
Source§impl From<EngineError> for VisionError
impl From<EngineError> for VisionError
Source§fn from(source: EngineError) -> Self
fn from(source: EngineError) -> Self
Source§impl From<Error> for EngineError
impl From<Error> for EngineError
Source§impl PdfError for EngineError
impl PdfError for EngineError
Auto Trait Implementations§
impl !RefUnwindSafe for EngineError
impl !UnwindSafe for EngineError
impl Freeze for EngineError
impl Send for EngineError
impl Sync for EngineError
impl Unpin for EngineError
impl UnsafeUnpin for EngineError
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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