JsonPointer

Struct JsonPointer 

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

Implementations§

Source§

impl JsonPointer

Source

pub const ROOT: &'static Self

Source

pub fn new<S>(s: &S) -> Result<&Self, 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<&Self, InvalidJsonPointer<&str>>

Source

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

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]) -> &Self

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, &Self)>

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

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

impl Default for &JsonPointer

Source§

fn default() -> Self

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

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

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::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

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

impl Hash for JsonPointer

Source§

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

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) -> Self::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::Ok, __S::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) -> Self::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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more