pub enum MutError {
Parse(LegacyError),
PathOutOfRange {
index: usize,
depth: usize,
len: usize,
},
PathTraversesLeaf {
depth: usize,
len: usize,
},
NotALeaf,
EmptyPath,
PageOutOfRange {
index: usize,
count: usize,
},
MissingPageInfo,
InfoParse(IffError),
IndirectDjvmUnsupported,
DirmMalformed(&'static str),
DirmComponentCountMismatch {
dirm: usize,
children: usize,
},
BookmarksRequireDjvm,
}Expand description
Errors produced by DjVuDocumentMut operations.
Variants§
Parse(LegacyError)
IFF parse error during DjVuDocumentMut::from_bytes.
PathOutOfRange
The path indexed past the end of a FORM’s children.
PathTraversesLeaf
The path traversed into a leaf chunk and tried to keep going.
NotALeaf
replace_leaf was called with a path that ends on a FORM chunk
rather than a leaf.
EmptyPath
The path is empty — must contain at least one index.
PageOutOfRange
page_mut was called with an index past the document’s page count.
MissingPageInfo
The page has no INFO chunk, which is required to encode chunks whose
payload depends on page height (currently set_text_layer).
InfoParse(IffError)
The page’s INFO chunk failed to parse.
IndirectDjvmUnsupported
The operation requires DIRM offset recomputation, which is not
implemented for indirect (non-bundled) FORM:DJVM documents — those
reference page bytes in external files via a resolver, so editing them
in place would also need the external files rewritten. Tracked as a
follow-up PR (PR5) in the
#222 sequence.
DirmMalformed(&'static str)
The DIRM chunk was malformed in a way that prevents offset
recomputation. Should not occur after a successful
DjVuDocumentMut::from_bytes on a well-formed DJVM document.
DirmComponentCountMismatch
The number of FORM:DJVU/FORM:DJVI components in the bundle does
not match the count recorded in DIRM. Indicates a structurally
inconsistent document.
Fields
BookmarksRequireDjvm
set_bookmarks was called on a FORM:DJVU (single-page) document.
NAVM bookmarks live in FORM:DJVM bundles only.
Trait Implementations§
Source§impl Error for MutError
impl Error for MutError
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<LegacyError> for MutError
impl From<LegacyError> for MutError
Source§fn from(source: LegacyError) -> Self
fn from(source: LegacyError) -> Self
Auto Trait Implementations§
impl Freeze for MutError
impl RefUnwindSafe for MutError
impl Send for MutError
impl Sync for MutError
impl Unpin for MutError
impl UnsafeUnpin for MutError
impl UnwindSafe for MutError
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
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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