pub struct DocumentError {
pub path: 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.
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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)>
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()
Source§impl From<DocumentError> for WriteError
impl From<DocumentError> for WriteError
Source§fn from(e: DocumentError) -> Self
fn from(e: DocumentError) -> Self
Converts to this type from the input type.
Source§impl From<DocumentError> for OmnistError
impl From<DocumentError> for OmnistError
Source§fn from(source: DocumentError) -> Self
fn from(source: DocumentError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DocumentError
impl PartialEq for DocumentError
Source§fn eq(&self, other: &DocumentError) -> bool
fn eq(&self, other: &DocumentError) -> bool
Tests for
self and other values to be equal, and is used by ==.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
Mutably borrows from an owned value. Read more
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.§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
Checks if this value is equivalent to the given key. Read more