Struct regex_automata::nfa::thompson::range_trie::State
source · struct State {
transitions: Vec<Transition>,
}
Expand description
A single state in this trie.
Fields§
§transitions: Vec<Transition>
A sorted sequence of non-overlapping transitions to other states. Each transition corresponds to a single range of bytes.
Implementations§
source§impl State
impl State
sourcefn find(&self, range: Utf8Range) -> usize
fn find(&self, range: Utf8Range) -> usize
Find the position at which the given range should be inserted in this state.
The position returned is always in the inclusive range [0, transitions.len()]. If ‘transitions.len()’ is returned, then the given range overlaps with no other range in this state and is greater than all of them.
For all other possible positions, the given range either overlaps with the transition at that position or is otherwise less than it with no overlap (and is greater than the previous transition). In the former case, careful attention must be paid to inserting this range as a new transition. In the latter case, the range can be inserted as a new transition at the given position without disrupting any other transitions.