pub struct JsonPathQueryBuilder { /* private fields */ }
Expand description

Builder for JsonPathQuery instances.

Examples

let builder = JsonPathQueryBuilder::new()
    .child(Label::new("a"))
    .descendant(Label::new("b"))
    .any_child()
    .child(Label::new("c"));

// Can also use `builder.build()`.
let query: JsonPathQuery = builder.into();

assert_eq!(format!("{query}"), "$['a']..['b'][*]['c']");

Implementations§

Initialize an empty builder.

Examples
let builder = JsonPathQueryBuilder::new();
let query: JsonPathQuery = builder.into();

assert_eq!(*query.root(), JsonPathQueryNode::Root(None));

Add a child selector with a given label.

Add a wildcard child selector.

Add a descendant selector with a given label.

Consume the builder and produce a JsonPathQuery.

Trait Implementations§

Returns the “default value” for a type. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.