pub trait JsonPathQueryNodeType {
    fn is_root(&self) -> bool;
    fn is_descendant(&self) -> bool;
    fn is_child(&self) -> bool;
    fn label(&self) -> Option<&Label>;
}
Expand description

Equips a struct with information on the type of JsonPathQueryNode it represents and methods to extract query elements from it.

Required Methods§

Returns true iff the type is JsonPathQueryNode::Root.

Returns true iff the type is JsonPathQueryNode::Descendant.

Returns true iff the type is JsonPathQueryNode::Child.

If the type is JsonPathQueryNode::Descendant or JsonPathQueryNode::Child returns the label it represents; otherwise, None.

Implementations on Foreign Types§

Utility blanket implementation for a JsonPathQueryNode wrapped in an Option.

If the value is None automatically returns false or None on all calls in the natural manner.

Implementors§