Struct rsonpath_lib::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 ==
.