#[non_exhaustive]pub enum IffError {
TooShort,
BadMagic {
got: [u8; 4],
},
UnknownFormType {
id: [u8; 4],
},
ChunkTooLong {
id: [u8; 4],
claimed: u32,
available: usize,
},
DepthLimitExceeded {
max: usize,
},
Truncated,
UnsupportedVersion {
version: u16,
},
}Expand description
Errors that can occur while parsing the IFF container.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooShort
Input data is too short to contain a valid IFF file.
BadMagic
The AT&T magic bytes were not found at the start of the file.
UnknownFormType
The FORM type identifier is not a recognised DjVu type.
Note: this is not an error — callers may encounter unknown form types in bundled documents and should handle them gracefully.
ChunkTooLong
A chunk header claims more bytes than are available in the buffer.
DepthLimitExceeded
A FORM nesting chain exceeded the structural inspection limit.
Truncated
The input ended unexpectedly in the middle of a chunk.
UnsupportedVersion
The INFO chunk declares a format version DjVuLibre itself refuses to
decode. DjVuLibre’s DJVUVERSION_TOO_NEW forward-compatibility
ceiling (libdjvu/DjVuInfo.h) is 50: if (info->version >= 50) throw "Cannot decode DjVu files with version>= 50". We match that ceiling
rather than silently decoding files DjVuLibre itself refuses.
Trait Implementations§
impl Eq for IffError
Source§impl Error for IffError
impl Error for IffError
1.30.0 · 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<IffError> for AsyncLazyError
impl From<IffError> for AsyncLazyError
impl StructuralPartialEq for IffError
Auto Trait Implementations§
impl Freeze for IffError
impl RefUnwindSafe for IffError
impl Send for IffError
impl Sync for IffError
impl Unpin for IffError
impl UnsafeUnpin for IffError
impl UnwindSafe for IffError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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