Struct json_pointer::JsonPointer
[−]
[src]
pub struct JsonPointer<S: AsRef<str>, C: AsRef<[S]>> { /* fields omitted */ }
A JSON Pointer.
Create a new JSON pointer with JsonPointer::new
, or parse one from a
string with str::parse()
.
Methods
impl<S: AsRef<str>, C: AsRef<[S]>> JsonPointer<S, C>
[src]
fn new(ref_toks: C) -> JsonPointer<S, C>
Creates a new JsonPointer from the given reference tokens.
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.
fn get_mut<'json>(
&self,
val: &'json mut Value
) -> Result<&'json mut Value, IndexError>
&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.
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.
impl<S: AsRef<str>> JsonPointer<S, Vec<S>>
[src]
fn push(&mut self, component: S)
Adds a component to the JSON pointer.
fn pop(&mut self) -> Option<S>
Removes and returns the last component from the JSON pointer.
Trait Implementations
impl<S: Clone + AsRef<str>, C: Clone + AsRef<[S]>> Clone for JsonPointer<S, C>
[src]
fn clone(&self) -> JsonPointer<S, C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<S: Debug + AsRef<str>, C: Debug + AsRef<[S]>> Debug for JsonPointer<S, C>
[src]
impl<S: Eq + AsRef<str>, C: Eq + AsRef<[S]>> Eq for JsonPointer<S, C>
[src]
impl<S: PartialEq + AsRef<str>, C: PartialEq + AsRef<[S]>> PartialEq for JsonPointer<S, C>
[src]
fn eq(&self, __arg_0: &JsonPointer<S, C>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &JsonPointer<S, C>) -> bool
This method tests for !=
.
impl<S: AsRef<str>, C: AsRef<[S]>> Display for JsonPointer<S, C>
[src]
fn fmt(&self, fmt: &mut Formatter) -> FmtResult
Formats the value using the given formatter. Read more