#[non_exhaustive]pub enum InvalidDocx {
Zip(InvalidZip),
Xml {
part: String,
source: InvalidXml,
},
MissingPart(String),
NotWordprocessingMl,
}Expand description
Error returned when Docx::from_bytes can’t open a file as a Word
document.
Part names come from the file: messages escape control characters in them.
The enum may grow new rejection reasons: match with a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Zip(InvalidZip)
The file is not a ZIP archive that can be read and written back, or
one of the parts that must be parsed can’t be decompressed - it is
corrupt, or exceeds the decompression budget. The
source says what is wrong.
Xml
A part that must be parsed is not well-formed XML, uses something
this crate doesn’t support, or makes the parts read exceed their
node budget (see InvalidXml and the limits of
Docx::from_bytes).
Fields
source: InvalidXmlWhat is wrong with the XML.
MissingPart(String)
A part the document needs is missing: [Content_Types].xml,
_rels/.rels, the main document part, or a header, footer,
footnotes or endnotes part the main part refers to. The part name
has no leading /.
NotWordprocessingMl
The package has no main document part, or its main part is not a
Transitional WordprocessingML document (w:document): the file is
a spreadsheet, a presentation or another kind of package, or a
Strict OOXML document.
Trait Implementations§
Source§impl Debug for InvalidDocx
impl Debug for InvalidDocx
Source§impl Display for InvalidDocx
impl Display for InvalidDocx
Source§impl Error for InvalidDocx
impl Error for InvalidDocx
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()