#[non_exhaustive]pub enum Error {
Syntax(String),
DocType,
TooDeep,
TooManyNodes,
NoRoot,
TooLarge,
NotUtf8(String),
NoSuchNode,
UndeclaredPrefix(String),
}Expand description
Why a part could not be read, or a node’s span or a fragment not given.
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.
Syntax(String)
The XML is not well formed.
DocType
The part has a DOCTYPE, which Office Open XML never uses.
TooDeep
The nesting is deeper than Limits::max_depth.
TooManyNodes
The part has more nodes than Limits::max_nodes.
NoRoot
The part has no root element.
TooLarge
The part has more bytes than a span can count, u32::MAX.
NotUtf8(String)
The part is not in UTF-8, as its byte order mark or its XML declaration says: the
encoding that it names. Its spans are not given (Document::span), because bytes in
UTF-8 in their place would garble it.
NoSuchNode
The document has no such node.
UndeclaredPrefix(String)
A fragment uses a namespace prefix that neither it nor the declarations in scope
declare (Document::parse_fragment).
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl RefUnwindSafe for Error
impl Send for Errorwhere
RawVecInner: Send,
impl Sync for Errorwhere
RawVecInner: Sync,
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Errorwhere
RawVecInner: UnwindSafe,
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