#[non_exhaustive]pub enum DocError {
Show 19 variants
Iff(IffError),
Bzz(BzzError),
Iw44(Iw44Error),
Jb2(Jb2Error),
NotDjVu([u8; 4]),
MissingChunk(&'static str),
Malformed(&'static str),
IndirectResolve(String),
ComponentResolve(ComponentResolveError),
ComponentKindMismatch {
component: ComponentId,
found: [u8; 4],
expected: ComponentKind,
},
PageOutOfRange {
index: usize,
count: usize,
},
InvalidUtf8,
NoResolver,
Io(Error),
Smmr(String),
Text(TextError),
Annotation(AnnotationError),
Metadata(MetadataError),
ResourceLimit(ResourceLimitExceeded),
}Expand description
Errors that can occur when working with the DjVuDocument API.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Iff(IffError)
IFF container parse error.
Bzz(BzzError)
BZZ decompression error.
Iw44(Iw44Error)
IW44 wavelet decoding error.
Jb2(Jb2Error)
JB2 bilevel image decoding error.
NotDjVu([u8; 4])
The file is not a supported DjVu format.
MissingChunk(&'static str)
A required chunk is missing.
Malformed(&'static str)
The document is malformed (description included).
IndirectResolve(String)
An indirect page reference could not be resolved.
ComponentResolve(ComponentResolveError)
A typed resolver could not provide one indirect component.
ComponentKindMismatch
A resolved component’s FORM type disagrees with its DIRM classification.
Fields
component: ComponentIdIdentity from the DIRM entry.
expected: ComponentKindFORM type required by the DIRM kind.
PageOutOfRange
Page index is out of range.
InvalidUtf8
Invalid UTF-8 in a string field.
No longer produced since #524: NAVM bookmark strings are decoded leniently (CP1252 fallback). Kept so matching code keeps compiling.
NoResolver
The resolver callback is required for indirect documents but was not provided.
Io(Error)
I/O error when reading file data (only with std feature).
Smmr(String)
G4/MMR mask decoding error.
Text(TextError)
Text layer parse error.
Annotation(AnnotationError)
Annotation parse error.
Metadata(MetadataError)
Metadata parse error.
ResourceLimit(ResourceLimitExceeded)
A configured resource limit was exceeded during document parse/open.
Trait Implementations§
Source§impl Error for DocError
impl Error for DocError
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<AnnotationError> for DocError
impl From<AnnotationError> for DocError
Source§fn from(source: AnnotationError) -> Self
fn from(source: AnnotationError) -> Self
Source§impl From<ComponentResolveError> for DocError
impl From<ComponentResolveError> for DocError
Source§fn from(source: ComponentResolveError) -> Self
fn from(source: ComponentResolveError) -> Self
Source§impl From<DocError> for RenderError
impl From<DocError> for RenderError
Source§impl From<DocError> for AsyncLazyError
impl From<DocError> for AsyncLazyError
Source§impl From<DocError> for TextSerializeError
impl From<DocError> for TextSerializeError
Source§impl From<MetadataError> for DocError
impl From<MetadataError> for DocError
Source§fn from(source: MetadataError) -> Self
fn from(source: MetadataError) -> Self
Source§impl From<ResourceLimitExceeded> for DocError
impl From<ResourceLimitExceeded> for DocError
Source§fn from(source: ResourceLimitExceeded) -> Self
fn from(source: ResourceLimitExceeded) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for DocError
impl !UnwindSafe for DocError
impl Freeze for DocError
impl Send for DocError
impl Sync for DocError
impl Unpin for DocError
impl UnsafeUnpin for DocError
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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