Enum rsonpath::query::JsonPathQueryNode
source · pub enum JsonPathQueryNode {
Root(Option<Box<JsonPathQueryNode>>),
Child(JsonString, Option<Box<JsonPathQueryNode>>),
AnyChild(Option<Box<JsonPathQueryNode>>),
Descendant(JsonString, Option<Box<JsonPathQueryNode>>),
AnyDescendant(Option<Box<JsonPathQueryNode>>),
ArrayIndexChild(NonNegativeArrayIndex, Option<Box<JsonPathQueryNode>>),
ArrayIndexDescendant(NonNegativeArrayIndex, Option<Box<JsonPathQueryNode>>),
}
Expand description
Linked list structure of a JSONPath query.
Variants§
Root(Option<Box<JsonPathQueryNode>>)
The first link in the list representing the root ‘$
’ character.
Child(JsonString, Option<Box<JsonPathQueryNode>>)
Represents direct descendant with a given property name (‘.
’ token).
AnyChild(Option<Box<JsonPathQueryNode>>)
Represents direct descendant with a wildcard (‘.*
’ tokens).
Descendant(JsonString, Option<Box<JsonPathQueryNode>>)
Represents recursive descent (‘..
’ token).
AnyDescendant(Option<Box<JsonPathQueryNode>>)
Represents recursive descendant with a wildcard (‘..*
’ tokens).
ArrayIndexChild(NonNegativeArrayIndex, Option<Box<JsonPathQueryNode>>)
Represents direct descendant list item with a positive index (numbers).
ArrayIndexDescendant(NonNegativeArrayIndex, Option<Box<JsonPathQueryNode>>)
Represents recursive descendant with an array index (‘..[n]
’ tokens).
Implementations§
Trait Implementations§
source§impl Debug for JsonPathQueryNode
impl Debug for JsonPathQueryNode
source§impl Display for JsonPathQueryNode
impl Display for JsonPathQueryNode
source§impl JsonPathQueryNodeType for JsonPathQueryNode
impl JsonPathQueryNodeType for JsonPathQueryNode
source§fn is_root(&self) -> bool
fn is_root(&self) -> bool
Returns
true
iff the type is JsonPathQueryNode::Root
.source§fn is_descendant(&self) -> bool
fn is_descendant(&self) -> bool
Returns
true
iff the type is JsonPathQueryNode::Descendant
.source§fn is_any_descendant(&self) -> bool
fn is_any_descendant(&self) -> bool
Returns
true
iff the type is JsonPathQueryNode::AnyDescendant
.source§fn is_child(&self) -> bool
fn is_child(&self) -> bool
Returns
true
iff the type is JsonPathQueryNode::Child
.source§fn is_any_child(&self) -> bool
fn is_any_child(&self) -> bool
Returns
true
iff the type is JsonPathQueryNode::AnyChild
.source§fn member_name(&self) -> Option<&JsonString>
fn member_name(&self) -> Option<&JsonString>
If the type is
JsonPathQueryNode::Descendant
or JsonPathQueryNode::Child
returns the member name it represents; otherwise, None
.source§fn array_index(&self) -> Option<&NonNegativeArrayIndex>
fn array_index(&self) -> Option<&NonNegativeArrayIndex>
If the type is
JsonPathQueryNode::ArrayIndexDescendant
or JsonPathQueryNode::ArrayIndexChild
returns the index it represents; otherwise, None
.source§impl PartialEq<JsonPathQueryNode> for JsonPathQueryNode
impl PartialEq<JsonPathQueryNode> for JsonPathQueryNode
source§fn eq(&self, other: &JsonPathQueryNode) -> bool
fn eq(&self, other: &JsonPathQueryNode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for JsonPathQueryNode
impl StructuralEq for JsonPathQueryNode
impl StructuralPartialEq for JsonPathQueryNode
Auto Trait Implementations§
impl RefUnwindSafe for JsonPathQueryNode
impl Send for JsonPathQueryNode
impl Sync for JsonPathQueryNode
impl Unpin for JsonPathQueryNode
impl UnwindSafe for JsonPathQueryNode
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