pub struct JsonPointer<'a>(/* private fields */);Expand description
A parsed JSON Pointer.
Implementations§
Source§impl JsonPointer<'static>
impl JsonPointer<'static>
Sourcepub fn parse_owned(s: &str) -> Result<Self, BadJsonPointerSyntax>
pub fn parse_owned(s: &str) -> Result<Self, BadJsonPointerSyntax>
Constructs a pointer from an RFC 6901 string, with segments that own their contents.
Source§impl<'a> JsonPointer<'a>
impl<'a> JsonPointer<'a>
Sourcepub fn parse(s: &'a str) -> Result<Self, BadJsonPointerSyntax>
pub fn parse(s: &'a str) -> Result<Self, BadJsonPointerSyntax>
Constructs a pointer from an RFC 6901 string, with segments that borrow from the string.
Sourcepub fn head(&self) -> Option<&JsonPointerSegment<'a>>
pub fn head(&self) -> Option<&JsonPointerSegment<'a>>
Returns the first segment of this pointer, or None
if this is an empty pointer.
Sourcepub fn tail(&self) -> JsonPointer<'_>
pub fn tail(&self) -> JsonPointer<'_>
Returns a new pointer without the first segment of this pointer. If this pointer has only one segment, or is an empty pointer, returns an empty pointer.
Sourcepub fn segments(&self) -> JsonPointerSegments<'_> ⓘ
pub fn segments(&self) -> JsonPointerSegments<'_> ⓘ
Returns a borrowing iterator over this pointer’s segments.
Sourcepub fn into_segments(self) -> IntoJsonPointerSegments<'a> ⓘ
pub fn into_segments(self) -> IntoJsonPointerSegments<'a> ⓘ
Returns a consuming iterator over this pointer’s segments.
Trait Implementations§
Source§impl<'a> Clone for JsonPointer<'a>
impl<'a> Clone for JsonPointer<'a>
Source§fn clone(&self) -> JsonPointer<'a>
fn clone(&self) -> JsonPointer<'a>
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<'a> Debug for JsonPointer<'a>
impl<'a> Debug for JsonPointer<'a>
Source§impl Display for JsonPointer<'_>
impl Display for JsonPointer<'_>
Source§impl<'a> Hash for JsonPointer<'a>
impl<'a> Hash for JsonPointer<'a>
Source§impl<'a> Ord for JsonPointer<'a>
impl<'a> Ord for JsonPointer<'a>
Source§fn cmp(&self, other: &JsonPointer<'a>) -> Ordering
fn cmp(&self, other: &JsonPointer<'a>) -> 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<'a> PartialEq for JsonPointer<'a>
impl<'a> PartialEq for JsonPointer<'a>
Source§impl<'a> PartialOrd for JsonPointer<'a>
impl<'a> PartialOrd for JsonPointer<'a>
impl<'a> Eq for JsonPointer<'a>
impl<'a> StructuralPartialEq for JsonPointer<'a>
Auto Trait Implementations§
impl<'a> Freeze for JsonPointer<'a>
impl<'a> RefUnwindSafe for JsonPointer<'a>
impl<'a> Send for JsonPointer<'a>
impl<'a> Sync for JsonPointer<'a>
impl<'a> Unpin for JsonPointer<'a>
impl<'a> UnwindSafe for JsonPointer<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more