pub enum DocxError {
Pdf(Error),
Extract(ExtractError),
Xml(Error),
Zip(ZipError),
Io(Error),
Other(String),
}Expand description
Errors returned by pdf-docx while converting a PDF to a DOCX
(Office Open XML WordprocessingML) document.
All variants except Other wrap an underlying error
from a more specific layer (PDF parsing, text extraction, XML, ZIP, I/O).
Surface the inner cause when reporting the failure.
Variants§
Pdf(Error)
The source PDF could not be parsed before conversion could begin.
Extract(ExtractError)
Text or layout extraction from the source PDF failed.
Xml(Error)
Building the DOCX document.xml body failed (malformed text run,
invalid attribute, encoding error in the XML serializer).
Zip(ZipError)
Packaging the DOCX archive failed (ZIP central directory error, invalid entry name, compression failure).
Io(Error)
An I/O error while reading the source PDF or writing the DOCX archive.
Other(String)
A non-categorised conversion failure. Reserved for cases the more specific variants do not cover; the message describes the situation.
Trait Implementations§
Source§impl Error for DocxError
impl Error for DocxError
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<ExtractError> for DocxError
impl From<ExtractError> for DocxError
Source§fn from(source: ExtractError) -> Self
fn from(source: ExtractError) -> Self
Auto Trait Implementations§
impl Freeze for DocxError
impl !RefUnwindSafe for DocxError
impl Send for DocxError
impl Sync for DocxError
impl Unpin for DocxError
impl UnsafeUnpin for DocxError
impl !UnwindSafe for DocxError
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