pub trait JsonPathQueryNodeType {
    // Required methods
    fn is_root(&self) -> bool;
    fn is_descendant(&self) -> bool;
    fn is_any_descendant(&self) -> bool;
    fn is_child(&self) -> bool;
    fn is_any_child(&self) -> bool;
    fn member_name(&self) -> Option<&JsonString>;
    fn array_index(&self) -> Option<&NonNegativeArrayIndex>;
}
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_any_descendant(&self) -> bool

Returns true iff the type is JsonPathQueryNode::AnyDescendant.

source

fn is_child(&self) -> bool

Returns true iff the type is JsonPathQueryNode::Child.

source

fn is_any_child(&self) -> bool

Returns true iff the type is JsonPathQueryNode::AnyChild.

source

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>

If the type is JsonPathQueryNode::ArrayIndexDescendant or JsonPathQueryNode::ArrayIndexChild returns the index 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.

Implementors§