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
impl Copy for Transition
impl Eq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Freeze for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnwindSafe for Transition
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)