pub struct JsonPath { /* private fields */ }Expand description
A compiled JSONPath expression.
Implementations§
Source§impl JsonPath
impl JsonPath
Sourcepub fn builder() -> JsonPathBuilder
pub fn builder() -> JsonPathBuilder
Returns a typed JSONPath builder.
Sourcepub fn from_segments(segments: impl Into<Vec<Segment>>) -> Self
pub fn from_segments(segments: impl Into<Vec<Segment>>) -> Self
Builds a path from already typed segments.
Sourcepub fn is_singular(&self) -> bool
pub fn is_singular(&self) -> bool
Whether this path only contains exact member and index selectors.
Sourcepub fn matches_path(&self, path: &[PathElement]) -> bool
pub fn matches_path(&self, path: &[PathElement]) -> bool
Returns whether this JSONPath matches an already tracked value path.
Sourcepub fn match_count(&self, path: &[PathElement]) -> usize
pub fn match_count(&self, path: &[PathElement]) -> usize
Returns how many ways this JSONPath matches an already tracked value path.
RFC 9535 selector lists preserve duplicate selections, so overlapping union members can match the same concrete path more than once.
Trait Implementations§
impl Eq for JsonPath
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