pub struct JsonPointerBuf(/* private fields */);Expand description
An owned JSON Pointer.
Implementations§
Source§impl JsonPointerBuf
impl JsonPointerBuf
Sourcepub fn parse(s: String) -> Result<Self, JsonPointerSyntaxError>
pub fn parse(s: String) -> Result<Self, JsonPointerSyntaxError>
Parses an owned pointer from an RFC 6901 string.
The empty string is the valid root pointer.
All other strings must start with /.
Methods from Deref<Target = JsonPointer>§
Sourcepub fn head(&self) -> Option<&JsonPointerSegment>
pub fn head(&self) -> Option<&JsonPointerSegment>
Returns the first segment, or None for the root pointer.
Sourcepub fn tail(&self) -> &JsonPointer
pub fn tail(&self) -> &JsonPointer
Returns the pointer without its first segment.
For the root pointer, returns the root pointer.
Sourcepub fn segments(&self) -> JsonPointerSegments<'_> ⓘ
pub fn segments(&self) -> JsonPointerSegments<'_> ⓘ
Returns a borrowing iterator over the segments.
Sourcepub fn follow<'a, T: JsonPointerTarget<'a>>(
&self,
root: &'a (impl JsonPointee + ?Sized),
) -> Result<T, JsonPointerError>
pub fn follow<'a, T: JsonPointerTarget<'a>>( &self, root: &'a (impl JsonPointee + ?Sized), ) -> Result<T, JsonPointerError>
Follows this pointer through root and extracts the result as T.
Trait Implementations§
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 Clone for JsonPointerBuf
impl Clone for JsonPointerBuf
Source§fn clone(&self) -> JsonPointerBuf
fn clone(&self) -> JsonPointerBuf
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonPointerBuf
impl Debug for JsonPointerBuf
Source§impl Deref for JsonPointerBuf
impl Deref for JsonPointerBuf
Source§impl Display for JsonPointerBuf
impl Display for JsonPointerBuf
Source§impl From<&JsonPointer> for JsonPointerBuf
impl From<&JsonPointer> for JsonPointerBuf
Source§fn from(value: &JsonPointer) -> Self
fn from(value: &JsonPointer) -> Self
Converts to this type from the input type.
Source§impl From<JsonPointerBuf> for Cow<'_, JsonPointer>
impl From<JsonPointerBuf> for Cow<'_, JsonPointer>
Source§fn from(value: JsonPointerBuf) -> Self
fn from(value: JsonPointerBuf) -> Self
Converts to this type from the input type.
Source§impl Hash for JsonPointerBuf
impl Hash for JsonPointerBuf
Source§impl Ord for JsonPointerBuf
impl Ord for JsonPointerBuf
Source§fn cmp(&self, other: &JsonPointerBuf) -> Ordering
fn cmp(&self, other: &JsonPointerBuf) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for JsonPointerBuf
impl PartialEq for JsonPointerBuf
Source§impl PartialOrd for JsonPointerBuf
impl PartialOrd for JsonPointerBuf
impl Eq for JsonPointerBuf
impl StructuralPartialEq for JsonPointerBuf
Auto Trait Implementations§
impl Freeze for JsonPointerBuf
impl RefUnwindSafe for JsonPointerBuf
impl Send for JsonPointerBuf
impl Sync for JsonPointerBuf
impl Unpin for JsonPointerBuf
impl UnsafeUnpin for JsonPointerBuf
impl UnwindSafe for JsonPointerBuf
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