pub struct JsonPointer(/* private fields */);Expand description
JSON Pointer.
Implementations§
Source§impl JsonPointer
impl JsonPointer
pub const ROOT: &'static Self
Sourcepub fn new<S>(s: &S) -> Result<&Self, InvalidJsonPointer<&S>>
pub fn new<S>(s: &S) -> Result<&Self, InvalidJsonPointer<&S>>
Converts the given string into a JSON pointer.
pub const fn from_str_const(s: &str) -> Result<&Self, InvalidJsonPointer<&str>>
Sourcepub const unsafe fn new_unchecked_str(s: &str) -> &Self
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.
Sourcepub const unsafe fn new_unchecked(s: &[u8]) -> &Self
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.
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, &Self)>
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§impl<'de> Deserialize<'de> for &'de JsonPointer
impl<'de> Deserialize<'de> for &'de JsonPointer
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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
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§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§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) -> Self::Owned
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)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more