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.