pub enum Error {
Package(Error),
Xml(Error),
Parse {
context: String,
message: String,
position: Option<u64>,
},
Invalid(String),
Unsupported(String),
MissingPart(String),
Utf8(FromUtf8Error),
Io(Error),
RawXml(Error),
}Expand description
Errors that can occur when working with Word documents.
Variants§
Package(Error)
Error from the core ooxml crate (packaging, relationships).
Xml(Error)
XML parsing error.
Parse
XML parsing error with location context.
Fields
Invalid(String)
Invalid or malformed document structure.
Unsupported(String)
Unsupported feature or element.
MissingPart(String)
Required part is missing from the package.
Utf8(FromUtf8Error)
UTF-8 decoding error.
Io(Error)
I/O error.
RawXml(Error)
Raw XML parsing error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn parse(context: impl Into<String>, message: impl Into<String>) -> Self
pub fn parse(context: impl Into<String>, message: impl Into<String>) -> Self
Create a parse error with context.
Sourcepub fn parse_at(
context: impl Into<String>,
message: impl Into<String>,
position: u64,
) -> Self
pub fn parse_at( context: impl Into<String>, message: impl Into<String>, position: u64, ) -> Self
Create a parse error with context and position.
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add context to an existing error.
Sourcepub fn at_position(self, position: u64) -> Self
pub fn at_position(self, position: u64) -> Self
Add position information to an existing error.
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)>
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()
Source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<SerializeError> for Error
impl From<SerializeError> for Error
Source§fn from(e: SerializeError) -> Self
fn from(e: SerializeError) -> Self
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more