#[non_exhaustive]pub enum HwpxError {
Zip(String),
InvalidMimetype {
actual: String,
},
MissingFile {
path: String,
},
XmlParse {
file: String,
detail: String,
},
InvalidAttribute {
element: String,
attribute: String,
value: String,
},
IndexOutOfBounds {
kind: &'static str,
index: u32,
max: u32,
},
InvalidStructure {
detail: String,
},
Io(Error),
Core(CoreError),
Foundation(FoundationError),
XmlSerialize {
detail: String,
},
}Expand description
Top-level error type for HWPX decoding operations.
Every fallible operation in smithy-hwpx returns Result<T, HwpxError>.
Both hwpforge_core::CoreError and
hwpforge_foundation::FoundationError convert via #[from].
§Examples
use hwpforge_smithy_hwpx::HwpxError;
let err = HwpxError::MissingFile {
path: "Contents/header.xml".into(),
};
assert!(err.to_string().contains("header.xml"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Zip(String)
ZIP archive could not be read or is corrupt.
InvalidMimetype
The mimetype entry has an unexpected value.
MissingFile
A required file is missing from the ZIP archive.
XmlParse
XML could not be deserialized.
Fields
InvalidAttribute
An attribute value could not be converted.
Fields
IndexOutOfBounds
A style index reference exceeds the header’s definition count.
Fields
InvalidStructure
Structural issue in the HWPX content.
Io(Error)
An I/O error occurred (e.g. reading a file from disk).
Core(CoreError)
A Core-layer error propagated upward.
Foundation(FoundationError)
A Foundation-layer error propagated upward.
XmlSerialize
XML serialization failure (encoder).
Implementations§
Trait Implementations§
Source§impl Error for HwpxError
impl Error for HwpxError
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<FoundationError> for HwpxError
impl From<FoundationError> for HwpxError
Source§fn from(source: FoundationError) -> Self
fn from(source: FoundationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HwpxError
impl !RefUnwindSafe for HwpxError
impl Send for HwpxError
impl Sync for HwpxError
impl Unpin for HwpxError
impl !UnwindSafe for HwpxError
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