pub struct Pointer { /* private fields */ }
Expand description
Represents a pointer to the data as defined in the RFC6901 - the JSON Pointer specification.
Implementations§
Source§impl Pointer
impl Pointer
pub fn push(&mut self, step: Step) -> &mut Self
pub fn pop(&mut self) -> Option<Step>
pub fn insert(&mut self, index: usize, step: Step)
pub fn remove(&mut self, index: usize) -> Step
Sourcepub fn traverse<'a>(&self, val: &'a Value) -> Option<ValuePointer<'a>>
pub fn traverse<'a>(&self, val: &'a Value) -> Option<ValuePointer<'a>>
Traverses the provided value and finds the data this pointer points to in it, if any.
pub fn traverse_mut<'a>( &self, val: &'a mut Value, ) -> Option<ValuePointerMut<'a>>
Sourcepub fn find<'a>(&self, val: &'a Value) -> Option<&'a Value>
pub fn find<'a>(&self, val: &'a Value) -> Option<&'a Value>
A simple override of traverse()
that directly exposes the found value, if any.
pub fn find_mut<'a>(&self, val: &'a mut Value) -> Option<&'a mut Value>
Trait Implementations§
Source§impl IntoIterator for Pointer
impl IntoIterator for Pointer
Source§impl PartialOrd for Pointer
impl PartialOrd for Pointer
impl Eq for Pointer
impl StructuralPartialEq for Pointer
Auto Trait Implementations§
impl Freeze for Pointer
impl RefUnwindSafe for Pointer
impl Send for Pointer
impl Sync for Pointer
impl Unpin for Pointer
impl UnwindSafe for Pointer
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