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: Pointer
The 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 Error for UnresolvableError
impl Error for UnresolvableError
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<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 for UnresolvableError
impl PartialEq for UnresolvableError
impl Eq for UnresolvableError
impl StructuralPartialEq for UnresolvableError
Auto Trait Implementations§
impl Freeze for UnresolvableError
impl RefUnwindSafe for UnresolvableError
impl Send for UnresolvableError
impl Sync for UnresolvableError
impl Unpin for UnresolvableError
impl UnwindSafe for UnresolvableError
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.