pub struct JsonPath { /* private fields */ }Expand description
A compiled RFC 9535 JSONPath expression.
Implementations§
Source§impl JsonPath
impl JsonPath
Sourcepub fn parse(expr: &str) -> Result<JsonPath, BabbelError>
pub fn parse(expr: &str) -> Result<JsonPath, BabbelError>
Parse and compile a JSONPath expression string into a reusable JsonPath instance.
Sourcepub fn query<'a>(&self, root: &'a Value) -> Vec<&'a Value>
pub fn query<'a>(&self, root: &'a Value) -> Vec<&'a Value>
Query borrowed references from a Value root node.
Sourcepub fn query_located<'a>(&self, root: &'a Value) -> Vec<LocatedNode<'a>>
pub fn query_located<'a>(&self, root: &'a Value) -> Vec<LocatedNode<'a>>
Query matched nodes alongside their RFC 9535 normalized paths and RFC 6901 JSON Pointers.
Trait Implementations§
impl StructuralPartialEq for JsonPath
Auto Trait Implementations§
impl Freeze for JsonPath
impl RefUnwindSafe for JsonPath
impl Send for JsonPath
impl Sync for JsonPath
impl Unpin for JsonPath
impl UnsafeUnpin for JsonPath
impl UnwindSafe for JsonPath
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