#[non_exhaustive]pub enum EpubError {
Phase(PhaseError),
Zip(ZipError),
Parse(String),
InvalidEpub(String),
Navigation(String),
Css(String),
Io(String),
ChapterOutOfBounds {
index: usize,
chapter_count: usize,
},
ManifestItemMissing {
idref: String,
},
ChapterNotUtf8 {
href: String,
},
LimitExceeded {
kind: LimitKind,
actual: usize,
limit: usize,
path: Option<String>,
},
BufferTooSmall {
required: usize,
provided: usize,
context: String,
},
}Expand description
Top-level error type for epub-stream operations
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.
Phase(PhaseError)
Typed phase-aware error with structured context.
Zip(ZipError)
ZIP archive error
Parse(String)
XML/XHTML parsing error
InvalidEpub(String)
Invalid EPUB structure (missing required files, broken references, etc.)
Navigation parsing error
Css(String)
CSS parsing error
Io(String)
I/O error (description only, since std::io::Error is not Clone)
ChapterOutOfBounds
Chapter index requested is out of bounds
Fields
ManifestItemMissing
Spine references a manifest item that does not exist
ChapterNotUtf8
Chapter content could not be decoded as UTF-8
LimitExceeded
Hard limit exceeded (typed error instead of OOM)
Fields
BufferTooSmall
Provided buffer is too small for the operation
Trait Implementations§
Source§impl Error for EpubError
Available on crate feature std only.
impl Error for EpubError
Available on crate feature
std only.1.30.0 · 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<PhaseError> for EpubError
impl From<PhaseError> for EpubError
Source§fn from(err: PhaseError) -> Self
fn from(err: PhaseError) -> Self
Converts to this type from the input type.
Source§impl From<RenderPrepError> for EpubError
impl From<RenderPrepError> for EpubError
Source§fn from(err: RenderPrepError) -> Self
fn from(err: RenderPrepError) -> Self
Converts to this type from the input type.
Source§impl From<TokenizeError> for EpubError
impl From<TokenizeError> for EpubError
Source§fn from(err: TokenizeError) -> Self
fn from(err: TokenizeError) -> Self
Converts to this type from the input type.
impl Eq for EpubError
impl StructuralPartialEq for EpubError
Auto Trait Implementations§
impl Freeze for EpubError
impl RefUnwindSafe for EpubError
impl Send for EpubError
impl Sync for EpubError
impl Unpin for EpubError
impl UnsafeUnpin for EpubError
impl UnwindSafe for EpubError
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