pub trait JsonPathQueryNodeType {
    // Required methods
    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§

source

fn is_root(&self) -> bool

Returns true iff the type is JsonPathQueryNode::Root.

source

fn is_descendant(&self) -> bool

Returns true iff the type is JsonPathQueryNode::Descendant.

source

fn is_child(&self) -> bool

Returns true iff the type is JsonPathQueryNode::Child.

source

fn label(&self) -> Option<&Label>

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

Implementations on Foreign Types§

source§

impl<T: Deref<Target = JsonPathQueryNode>> JsonPathQueryNodeType for Option<T>

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.

source§

fn is_root(&self) -> bool

source§

fn is_descendant(&self) -> bool

source§

fn is_child(&self) -> bool

source§

fn label(&self) -> Option<&Label>

Implementors§