pub enum Error {
Index(IndexError),
Unresolvable(UnresolvableError),
NotFound(NotFoundError),
MalformedPointer(MalformedPointerError),
}Expand description
An enum representing possible errors that can occur when resolving or mutating by a JSON Pointer.
Variants§
Index(IndexError)
Indicates an error occurred while parsing a usize (ParseError) or the
parsed value was out of bounds for the targeted array.
Unresolvable(UnresolvableError)
Represents an error that occurs when attempting to resolve a Pointer that
encounters a leaf node (i.e. a scalar / null value) which is not the root
of the Pointer.
NotFound(NotFoundError)
Indicates that a Pointer was not found in the data.
MalformedPointer(MalformedPointerError)
Indicates that a Pointer was malformed.
Implementations§
source§impl Error
impl Error
sourcepub fn is_unresolvable(&self) -> bool
pub fn is_unresolvable(&self) -> bool
Returns true if the error is Error::UnresolvableError.
sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if the error is Error::NotFoundError.
sourcepub fn is_malformed_pointer(&self) -> bool
pub fn is_malformed_pointer(&self) -> bool
Returns true if the error is Error::MalformedPointerError.
Trait Implementations§
source§impl From<IndexError> for Error
impl From<IndexError> for Error
source§fn from(err: IndexError) -> Self
fn from(err: IndexError) -> Self
Converts to this type from the input type.
source§impl From<MalformedPointerError> for Error
impl From<MalformedPointerError> for Error
source§fn from(err: MalformedPointerError) -> Self
fn from(err: MalformedPointerError) -> Self
Converts to this type from the input type.
source§impl From<NotFoundError> for Error
impl From<NotFoundError> for Error
source§fn from(err: NotFoundError) -> Self
fn from(err: NotFoundError) -> Self
Converts to this type from the input type.
source§impl From<OutOfBoundsError> for Error
impl From<OutOfBoundsError> for Error
source§fn from(err: OutOfBoundsError) -> Self
fn from(err: OutOfBoundsError) -> Self
Converts to this type from the input type.
source§impl From<UnresolvableError> for Error
impl From<UnresolvableError> for Error
source§fn from(err: UnresolvableError) -> Self
fn from(err: UnresolvableError) -> Self
Converts to this type from the input type.
source§impl PartialEq<Error> for Error
impl PartialEq<Error> for Error
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin 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