pub struct Automaton<'q> { /* private fields */ }
Expand description

A minimal, deterministic automaton representing a JSONPath query.

Implementations

Convert a JsonPathQuery into a minimal deterministic automaton.

Returns whether this automaton represents an empty JSONPath query (‘$’).

Examples
let query = JsonPathQuery::parse("$").unwrap();
let automaton = Automaton::new(&query);

assert!(automaton.is_empty_query());
let query = JsonPathQuery::parse("$.a").unwrap();
let automaton = Automaton::new(&query);

assert!(!automaton.is_empty_query());

Returns the rejecting state of the automaton.

The state is defined as the unique state from which there exists no accepting run. If the query automaton reaches this state, the current subtree is guaranteed to have no matches.

Returns the initial state of the automaton.

Query execution should start from this state.

Returns the accepting state of the automaton.

Query execution should treat transitioning into this state as a match.

Returns whether the given state is accepting.

Example
let query = JsonPathQuery::parse("$.a").unwrap();
let automaton = Automaton::new(&query);

assert!(automaton.is_accepting(automaton.accepting_state()));

Returns whether the given state is rejecting, i.e. there exist no accepting runs from it.

Example
let query = JsonPathQuery::parse("$.a").unwrap();
let automaton = Automaton::new(&query);

assert!(automaton.is_rejecting(automaton.rejecting_state()));

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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.

Converts the given value to a String. Read more
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.