pub struct JsonPointer<'a> { /* private fields */ }
Expand description
A structure representing a complete pointer, comprising multiple JsonPointerComponents
Implementations§
Source§impl<'a> JsonPointer<'a>
impl<'a> JsonPointer<'a>
Sourcepub fn root() -> Self
pub fn root() -> Self
Returns a root JsonPointer instance
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of JsonPointerComponents within the pointer
Sourcepub fn push_names(&mut self, names: &[&'a str])
pub fn push_names(&mut self, names: &[&'a str])
Push a whole bunch of names onto the end of the path in order
Sourcepub fn push_indexes(&mut self, indexes: &[usize])
pub fn push_indexes(&mut self, indexes: &[usize])
Push a whole bunch of indexes onto the end of the path in order
Sourcepub fn push_name(&mut self, name: String)
pub fn push_name(&mut self, name: String)
Push a new JsonPointerComponent::Name onto the end of the pointer
Sourcepub fn push_index(&mut self, index: usize)
pub fn push_index(&mut self, index: usize)
Push a new JsonPointerComponent::Index onto the end of the pointer
Sourcepub fn pop(&mut self) -> Option<JsonPointerComponent<'a>>
pub fn pop(&mut self) -> Option<JsonPointerComponent<'a>>
Pop the last component off the back of the pointer
Sourcepub fn matches(&self, rhs: &'a JsonPointer<'_>) -> bool
pub fn matches(&self, rhs: &'a JsonPointer<'_>) -> bool
Checks whether a path matches another path.
Trait Implementations§
Source§impl<'a> Add<&JsonPointer<'a>> for JsonPointer<'a>
impl<'a> Add<&JsonPointer<'a>> for JsonPointer<'a>
Source§fn add(self, rhs: &JsonPointer<'a>) -> Self
fn add(self, rhs: &JsonPointer<'a>) -> Self
Concatenate two JsonPointer instances.
Source§type Output = JsonPointer<'a>
type Output = JsonPointer<'a>
The resulting type after applying the
+
operator.Source§impl<'a> Debug for JsonPointer<'a>
impl<'a> Debug for JsonPointer<'a>
Source§impl<'a> Default for JsonPointer<'a>
impl<'a> Default for JsonPointer<'a>
Source§fn default() -> JsonPointer<'a>
fn default() -> JsonPointer<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> Display for JsonPointer<'a>
impl<'a> Display for JsonPointer<'a>
Source§impl<'a> Hash for JsonPointer<'a>
impl<'a> Hash for JsonPointer<'a>
Source§impl<'a> PartialEq for JsonPointer<'a>
impl<'a> PartialEq for JsonPointer<'a>
impl<'a> Eq 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