pub struct JsonPointer<S: AsRef<str>, C: AsRef<[S]>> { /* private fields */ }
Expand description
A JSON Pointer.
Create a new JSON pointer with JsonPointer::new
, or parse one from a
string with str::parse()
.
Implementations§
Source§impl<S: AsRef<str>, C: AsRef<[S]>> JsonPointer<S, C>
impl<S: AsRef<str>, C: AsRef<[S]>> JsonPointer<S, C>
Sourcepub fn new(ref_toks: C) -> JsonPointer<S, C>
pub fn new(ref_toks: C) -> JsonPointer<S, C>
Creates a new JsonPointer from the given reference tokens.
Sourcepub fn get<'json>(&self, val: &'json Value) -> Result<&'json Value, IndexError>
pub fn get<'json>(&self, val: &'json Value) -> Result<&'json Value, IndexError>
Attempts to get a reference to a value from the given JSON value, returning an error if it can’t be found.
Sourcepub fn get_mut<'json>(
&self,
val: &'json mut Value,
) -> Result<&'json mut Value, IndexError>
pub fn get_mut<'json>( &self, val: &'json mut Value, ) -> Result<&'json mut Value, IndexError>
Attempts to get a mutable reference to a value from the given JSON value, returning an error if it can’t be found.
Sourcepub fn get_owned(&self, val: Value) -> Result<Value, IndexError>
pub fn get_owned(&self, val: Value) -> Result<Value, IndexError>
Attempts to get an owned value from the given JSON value, returning an error if it can’t be found.
Sourcepub fn uri_fragment(&self) -> String
pub fn uri_fragment(&self) -> String
Converts a JSON pointer to a string in URI Fragment Identifier
Representation, including the leading #
.
Trait Implementations§
Source§impl<S: Clone + AsRef<str>, C: Clone + AsRef<[S]>> Clone for JsonPointer<S, C>
impl<S: Clone + AsRef<str>, C: Clone + AsRef<[S]>> Clone for JsonPointer<S, C>
Source§fn clone(&self) -> JsonPointer<S, C>
fn clone(&self) -> JsonPointer<S, C>
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 moreimpl<S: Eq + AsRef<str>, C: Eq + AsRef<[S]>> Eq for JsonPointer<S, C>
impl<S: AsRef<str>, C: AsRef<[S]>> StructuralPartialEq for JsonPointer<S, C>
Auto Trait Implementations§
impl<S, C> Freeze for JsonPointer<S, C>where
C: Freeze,
impl<S, C> RefUnwindSafe for JsonPointer<S, C>where
C: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, C> Send for JsonPointer<S, C>
impl<S, C> Sync for JsonPointer<S, C>
impl<S, C> Unpin for JsonPointer<S, C>
impl<S, C> UnwindSafe for JsonPointer<S, C>where
C: UnwindSafe,
S: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)