Struct rsonpath::query::JsonPathQuery
source · pub struct JsonPathQuery { /* private fields */ }
Expand description
JSONPath query structure represented by the root link of the
JsonPathQueryNode
list.
Implementations§
source§impl JsonPathQuery
impl JsonPathQuery
sourcepub fn root(&self) -> &JsonPathQueryNode
pub fn root(&self) -> &JsonPathQueryNode
Retrieve reference to the root node.
It is guaranteed that the root is the JsonPathQueryNode::Root
variant and always exists.
sourcepub fn parse(query_string: &str) -> Result<Self, ParserError>
pub fn parse(query_string: &str) -> Result<Self, ParserError>
Parse a query string into a JsonPathQuery
.
Errors
Will return a ParserError
if the query_string
does
not conform to the JSONPath grammar. See its documentation
for details.
sourcepub fn new(node: Box<JsonPathQueryNode>) -> Self
pub fn new(node: Box<JsonPathQueryNode>) -> Self
Create a query from a root node.
If node is not the JsonPathQueryNode::Root
variant it will be
automatically wrapped into a JsonPathQueryNode::Root
node.
Trait Implementations§
source§impl Debug for JsonPathQuery
impl Debug for JsonPathQuery
source§impl Display for JsonPathQuery
impl Display for JsonPathQuery
source§impl From<JsonPathQueryBuilder> for JsonPathQuery
impl From<JsonPathQueryBuilder> for JsonPathQuery
source§fn from(value: JsonPathQueryBuilder) -> Self
fn from(value: JsonPathQueryBuilder) -> Self
Converts to this type from the input type.
source§impl PartialEq<JsonPathQuery> for JsonPathQuery
impl PartialEq<JsonPathQuery> for JsonPathQuery
source§fn eq(&self, other: &JsonPathQuery) -> bool
fn eq(&self, other: &JsonPathQuery) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for JsonPathQuery
impl StructuralEq for JsonPathQuery
impl StructuralPartialEq for JsonPathQuery
Auto Trait Implementations§
impl RefUnwindSafe for JsonPathQuery
impl Send for JsonPathQuery
impl Sync for JsonPathQuery
impl Unpin for JsonPathQuery
impl UnwindSafe for JsonPathQuery
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