pub struct JsonPointer(/* private fields */);Expand description
JSON Pointer.
Implementations§
Source§impl JsonPointer
impl JsonPointer
pub const ROOT: &'static JsonPointer
Sourcepub fn new<S>(s: &S) -> Result<&JsonPointer, InvalidJsonPointer<&S>>
pub fn new<S>(s: &S) -> Result<&JsonPointer, InvalidJsonPointer<&S>>
Converts the given string into a JSON pointer.
pub const fn from_str_const( s: &str, ) -> Result<&JsonPointer, InvalidJsonPointer<&str>>
Sourcepub const unsafe fn new_unchecked_str(s: &str) -> &JsonPointer
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.
Sourcepub const unsafe fn new_unchecked(s: &[u8]) -> &JsonPointer
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.
Sourcepub const fn validate_bytes(s: &[u8]) -> bool
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.
Sourcepub const fn validate_str(s: &str) -> bool
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.
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_str(&self) -> &str
pub fn is_empty(&self) -> bool
pub fn split_first(&self) -> Option<(&ReferenceToken, &JsonPointer)>
pub fn iter(&self) -> JsonPointerIter<'_> ⓘ
Trait Implementations§
Source§impl AsRef<JsonPointer> for JsonPointer
impl AsRef<JsonPointer> for JsonPointer
Source§fn as_ref(&self) -> &JsonPointer
fn as_ref(&self) -> &JsonPointer
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<JsonPointer> for JsonPointerBuf
impl AsRef<JsonPointer> for JsonPointerBuf
Source§fn as_ref(&self) -> &JsonPointer
fn as_ref(&self) -> &JsonPointer
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<JsonPointer> for JsonPointerBuf
impl Borrow<JsonPointer> for JsonPointerBuf
Source§fn borrow(&self) -> &JsonPointer
fn borrow(&self) -> &JsonPointer
Immutably borrows from an owned value. Read more
Source§impl Debug for JsonPointer
impl Debug for JsonPointer
Source§impl Default for &JsonPointer
impl Default for &JsonPointer
Source§fn default() -> &JsonPointer
fn default() -> &JsonPointer
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for &'de JsonPointer
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>,
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
impl Display for JsonPointer
Source§impl Hash for JsonPointer
impl Hash for JsonPointer
Source§impl<'a> IntoIterator for &'a JsonPointer
impl<'a> IntoIterator for &'a JsonPointer
Source§type Item = &'a ReferenceToken
type Item = &'a ReferenceToken
The type of the elements being iterated over.
Source§type IntoIter = JsonPointerIter<'a>
type IntoIter = JsonPointerIter<'a>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a JsonPointer as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a JsonPointer as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl Ord for JsonPointer
impl Ord for JsonPointer
Source§impl PartialEq for JsonPointer
impl PartialEq for JsonPointer
Source§impl PartialOrd for JsonPointer
impl PartialOrd for JsonPointer
Source§impl Serialize for JsonPointer
impl Serialize for JsonPointer
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl ToOwned for JsonPointer
Source§type Owned = JsonPointerBuf
type Owned = JsonPointerBuf
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> <JsonPointer as ToOwned>::Owned
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)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Eq for JsonPointer
impl StructuralPartialEq for JsonPointer
Auto Trait Implementations§
impl Freeze for JsonPointer
impl RefUnwindSafe for JsonPointer
impl Send for JsonPointer
impl !Sized for JsonPointer
impl Sync for JsonPointer
impl Unpin for JsonPointer
impl UnwindSafe for JsonPointer
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> CallHasher for T
impl<T> CallHasher for T
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.