Struct regex_automata::dfa::onepass::Transition
source · struct Transition(u64);
Expand description
Represents a single transition in a one-pass DFA.
The high 21 bits corresponds to the state ID. The bit following corresponds to the special “match wins” flag. The remaining low 42 bits corresponds to the transition epsilons, which contains the slots that should be saved when this transition is followed and the conditional epsilon transitions that must be satisfied in order to follow this transition.
Tuple Fields§
§0: u64
Implementations§
source§impl Transition
impl Transition
const STATE_ID_BITS: u64 = 21u64
const STATE_ID_SHIFT: u64 = 43u64
const STATE_ID_LIMIT: u64 = 2_097_152u64
const MATCH_WINS_SHIFT: u64 = 42u64
const INFO_MASK: u64 = 4_398_046_511_103u64
sourcefn new(match_wins: bool, sid: StateID, epsilons: Epsilons) -> Transition
fn new(match_wins: bool, sid: StateID, epsilons: Epsilons) -> Transition
Return a new transition to the given state ID with the given epsilons.
sourcefn match_wins(&self) -> bool
fn match_wins(&self) -> bool
Return whether this transition has a “match wins” property.
When a transition has this property, it means that if a match has been found and the search uses leftmost-first semantics, then that match should be returned immediately instead of continuing on.
The “match wins” name comes from RE2, which uses a pretty much identical mechanism for implementing leftmost-first semantics.
sourcefn set_state_id(&mut self, sid: StateID)
fn set_state_id(&mut self, sid: StateID)
Set the “next” state ID in this transition.
Trait Implementations§
source§impl Clone for Transition
impl Clone for Transition
source§fn clone(&self) -> Transition
fn clone(&self) -> Transition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Transition
impl Debug for Transition
source§impl PartialEq for Transition
impl PartialEq for Transition
source§fn eq(&self, other: &Transition) -> bool
fn eq(&self, other: &Transition) -> bool
self
and other
values to be equal, and is used
by ==
.