pub struct DocumentError {
pub path: String,
pub code: Option<String>,
pub message: String,
}Expand description
A Document operation is invalid, or a plain value is not a legal Document.
Raised by crate::document when a construction or mutation would
produce something outside the Document model (a bare top-level array, an
array of arrays, nesting past the max depth) or when an operation doesn’t
fit the node it’s called on (e.g. reading .value() on an internal
node). The message carries the offending path, matching the Python
reference’s DocumentError convention of embedding path in the text.
Fields§
§path: StringThe path inside the document where the error occurred.
code: Option<String>The spec’s stable machine-readable code (omnist-spec §8.3.2 and
§8.3.8, e.g. document.unlabeled-element,
format.dtd-forbidden), when the failure is one the taxonomy names.
None for API-misuse errors (reading .value() on an internal
node, get_one on a repeated label, …) that no conformance
diagnostic describes.
message: StringHuman-readable error description.
Implementations§
Trait Implementations§
Source§impl Clone for DocumentError
impl Clone for DocumentError
Source§fn clone(&self) -> DocumentError
fn clone(&self) -> DocumentError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DocumentError
impl Debug for DocumentError
Source§impl Display for DocumentError
impl Display for DocumentError
impl Eq for DocumentError
Source§impl Error for DocumentError
impl Error for DocumentError
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<DocumentError> for WriteError
impl From<DocumentError> for WriteError
Source§fn from(e: DocumentError) -> Self
fn from(e: DocumentError) -> Self
Source§impl From<DocumentError> for OmnistError
impl From<DocumentError> for OmnistError
Source§fn from(source: DocumentError) -> Self
fn from(source: DocumentError) -> Self
Source§impl PartialEq for DocumentError
impl PartialEq for DocumentError
impl StructuralPartialEq for DocumentError
Auto Trait Implementations§
impl Freeze for DocumentError
impl RefUnwindSafe for DocumentError
impl Send for DocumentError
impl Sync for DocumentError
impl Unpin for DocumentError
impl UnsafeUnpin for DocumentError
impl UnwindSafe for DocumentError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.