Struct jsonptr::UnresolvableError
source · pub struct UnresolvableError {
pub pointer: Pointer,
pub leaf: Option<Token>,
}Expand description
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.
Example
use serde_json::json;
use jsonptr::{Pointer, ResolveMut, Resolve, UnresolvableError};
let mut data = json!({ "foo": "bar" });
let ptr = Pointer::try_from("/foo/unreachable").unwrap();
let err = data.resolve_mut(&ptr).unwrap_err();
assert_eq!(err, UnresolvableError::new(ptr.clone()).into());Fields§
§pointer: PointerThe unresolved Pointer.
leaf: Option<Token>The leaf node, if applicable, which was expected to be either an
Object or an Array.
Implementations§
Trait Implementations§
source§impl Clone for UnresolvableError
impl Clone for UnresolvableError
source§fn clone(&self) -> UnresolvableError
fn clone(&self) -> UnresolvableError
Returns a copy of the value. Read more
1.0.0 · 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 UnresolvableError
impl Debug for UnresolvableError
source§impl Display for UnresolvableError
impl Display for UnresolvableError
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<UnresolvableError> for UnresolvableError
impl PartialEq<UnresolvableError> for UnresolvableError
source§fn eq(&self, other: &UnresolvableError) -> bool
fn eq(&self, other: &UnresolvableError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.