[][src]Struct json_pointer::JsonPointer

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().

Implementations

impl<S: AsRef<str>, C: AsRef<[S]>> JsonPointer<S, C>[src]

pub fn new(ref_toks: C) -> JsonPointer<S, C>[src]

Creates a new JsonPointer from the given reference tokens.

pub fn get<'json>(&self, val: &'json Value) -> Result<&'json Value, IndexError>[src]

Attempts to get a reference to a value from the given JSON value, returning an error if it can't be found.

pub fn get_mut<'json>(
    &self,
    val: &'json mut Value
) -> Result<&'json mut Value, IndexError>
[src]

Attempts to get a mutable reference to a value from the given JSON value, returning an error if it can't be found.

pub fn get_owned(&self, val: Value) -> Result<Value, IndexError>[src]

Attempts to get an owned value from the given JSON value, returning an error if it can't be found.

pub fn uri_fragment(&self) -> String[src]

Converts a JSON pointer to a string in URI Fragment Identifier Representation, including the leading #.

impl<S: AsRef<str>> JsonPointer<S, Vec<S>>[src]

pub fn push(&mut self, component: S)[src]

Adds a component to the JSON pointer.

pub fn pop(&mut self) -> Option<S>[src]

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]

impl<S: Debug + AsRef<str>, C: Debug + AsRef<[S]>> Debug for JsonPointer<S, C>[src]

impl<S: AsRef<str>, C: AsRef<[S]>> Display for JsonPointer<S, C>[src]

impl<S: Eq + AsRef<str>, C: Eq + AsRef<[S]>> Eq for JsonPointer<S, C>[src]

impl FromStr for JsonPointer<String, Vec<String>>[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl<'a, S: AsRef<str>, C: AsRef<[S]>> Index<&'a JsonPointer<S, C>> for Value[src]

type Output = Value

The returned type after indexing.

impl<'a, S: AsRef<str>, C: AsRef<[S]>> IndexMut<&'a JsonPointer<S, C>> for Value[src]

impl<S: PartialEq + AsRef<str>, C: PartialEq + AsRef<[S]>> PartialEq<JsonPointer<S, C>> for JsonPointer<S, C>[src]

impl<S: AsRef<str>, C: AsRef<[S]>> StructuralEq for JsonPointer<S, C>[src]

impl<S: AsRef<str>, C: AsRef<[S]>> StructuralPartialEq for JsonPointer<S, C>[src]

Auto Trait Implementations

impl<S, C> RefUnwindSafe for JsonPointer<S, C> where
    C: RefUnwindSafe,
    S: RefUnwindSafe

impl<S, C> Send for JsonPointer<S, C> where
    C: Send,
    S: Send

impl<S, C> Sync for JsonPointer<S, C> where
    C: Sync,
    S: Sync

impl<S, C> Unpin for JsonPointer<S, C> where
    C: Unpin,
    S: Unpin

impl<S, C> UnwindSafe for JsonPointer<S, C> where
    C: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.