JsonPointer

Struct JsonPointer 

Source
pub struct JsonPointer(/* private fields */);
Expand description

Implementations§

Source§

impl JsonPointer

Source

pub const ROOT: &'static JsonPointer

Source

pub fn new<S>(s: &S) -> Result<&JsonPointer, InvalidJsonPointer<&S>>
where S: AsRef<[u8]> + ?Sized,

Converts the given string into a JSON pointer.

Source

pub const fn from_str_const( s: &str, ) -> Result<&JsonPointer, InvalidJsonPointer<&str>>

Source

pub const unsafe fn new_unchecked_str(s: &str) -> &JsonPointer

Converts the given string into a JSON pointer without validation.

§Safety

The input string must be a valid JSON pointer.

Source

pub const unsafe fn new_unchecked(s: &[u8]) -> &JsonPointer

Converts the given string into a JSON pointer without validation.

§Safety

The input string must be a valid JSON pointer.

Source

pub const fn validate_bytes(s: &[u8]) -> bool

Confirms the validity of a string such that it may be safely used for Self::new_unchecked.

Source

pub const fn validate_str(s: &str) -> bool

Confirms the validity of a string such that it may be safely used for Self::new_unchecked_str.

Source

pub fn as_bytes(&self) -> &[u8]

Source

pub fn as_str(&self) -> &str

Source

pub fn is_empty(&self) -> bool

Source

pub fn split_first(&self) -> Option<(&ReferenceToken, &JsonPointer)>

Source

pub fn iter(&self) -> JsonPointerIter<'_>

Trait Implementations§

Source§

impl AsRef<JsonPointer> for JsonPointer

Source§

fn as_ref(&self) -> &JsonPointer

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<JsonPointer> for JsonPointerBuf

Source§

fn as_ref(&self) -> &JsonPointer

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<JsonPointer> for JsonPointerBuf

Source§

fn borrow(&self) -> &JsonPointer

Immutably borrows from an owned value. Read more
Source§

impl Debug for JsonPointer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for &JsonPointer

Source§

fn default() -> &JsonPointer

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for &'de JsonPointer

Source§

fn deserialize<D>( deserializer: D, ) -> Result<&'de JsonPointer, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for JsonPointer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Hash for JsonPointer

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl<'a> IntoIterator for &'a JsonPointer

Source§

type Item = &'a ReferenceToken

The type of the elements being iterated over.
Source§

type IntoIter = JsonPointerIter<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a JsonPointer as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl Ord for JsonPointer

Source§

fn cmp(&self, other: &JsonPointer) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq for JsonPointer

Source§

fn eq(&self, other: &JsonPointer) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for JsonPointer

Source§

fn partial_cmp(&self, other: &JsonPointer) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for JsonPointer

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToOwned for JsonPointer

Source§

type Owned = JsonPointerBuf

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> <JsonPointer as ToOwned>::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl Eq for JsonPointer

Source§

impl StructuralPartialEq for JsonPointer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> WithContext for T
where T: ?Sized,

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>