pub enum Error {
BadVersion(String),
UnsupportedMajor(u64),
UnsupportedMinor(u64),
EmptyPath(usize),
EmptyPathSegment(usize),
EmptyAttrName(usize),
EmptyValueSet(usize, String),
DuplicatePath(Vec<String>),
}Expand description
Why a snapshot is not well-formed, or a version cannot be parsed.
Variants§
BadVersion(String)
protocol_version is not a parseable MAJOR.MINOR.PATCH.
UnsupportedMajor(u64)
The snapshot’s MAJOR differs from crate::SUPPORTED_PROTOCOL_MAJOR.
UnsupportedMinor(u64)
The snapshot’s MINOR differs from crate::SUPPORTED_PROTOCOL_MINOR. Only
enforced while MAJOR is 0, where a MINOR bump may move the canonical form (SPEC §10).
EmptyPath(usize)
A node at the given index has an empty path.
EmptyPathSegment(usize)
A node at the given index has an empty segment in its path ([""]).
EmptyAttrName(usize)
A node at the given index has an empty attribute name ({"":[…]}).
EmptyValueSet(usize, String)
A node (index) has an attribute (name) that maps to an empty value set ({"a":[]}).
DuplicatePath(Vec<String>)
Two nodes share the same identity (path) within one snapshot.
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 Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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