Struct regex_automata::util::determinize::state::ReprVec
source · struct ReprVec<'a>(&'a mut Vec<u8>);
Expand description
ReprVec is a write-only view into the representation of a DFA state.
See Repr for more details on the purpose of this type and also the format.
Note that not all possible combinations of methods may be called. This is precisely what the various StateBuilder types encapsulate: they only permit valid combinations via Rust’s linear typing.
Tuple Fields§
§0: &'a mut Vec<u8>
Implementations§
source§impl<'a> ReprVec<'a>
impl<'a> ReprVec<'a>
sourcefn set_is_match(&mut self)
fn set_is_match(&mut self)
Set this state as a match state.
This should not be exposed explicitly outside of this module. It is set automatically when a pattern ID is added.
sourcefn set_has_pattern_ids(&mut self)
fn set_has_pattern_ids(&mut self)
Set that this state has pattern IDs explicitly written to it.
This should not be exposed explicitly outside of this module. This is used internally as a space saving optimization. Namely, if the state is a match state but does not have any pattern IDs written to it, then it is automatically inferred to have a pattern ID of ZERO.
sourcefn set_is_from_word(&mut self)
fn set_is_from_word(&mut self)
Set this state as being built from a transition over a word byte.
Setting this is only necessary when one needs to deal with word boundary assertions. Therefore, if the underlying NFA has no word boundary assertions, callers should not set this.
sourcefn set_is_half_crlf(&mut self)
fn set_is_half_crlf(&mut self)
Set this state as having seen half of a CRLF terminator.
In the forward direction, this should be set when a \r
has been seen.
In the reverse direction, this should be set when a \n
has been seen.
sourcefn look_have(&self) -> LookSet
fn look_have(&self) -> LookSet
The set of look-behind assertions that were true in the transition that created this state.
sourcefn look_need(&self) -> LookSet
fn look_need(&self) -> LookSet
The set of look-around (both behind and ahead) assertions that appear at least once in this state’s set of NFA states.
sourcefn set_look_have(&mut self, set: impl FnMut(LookSet) -> LookSet)
fn set_look_have(&mut self, set: impl FnMut(LookSet) -> LookSet)
Mutate the set of look-behind assertions that were true in the transition that created this state.
sourcefn set_look_need(&mut self, set: impl FnMut(LookSet) -> LookSet)
fn set_look_need(&mut self, set: impl FnMut(LookSet) -> LookSet)
Mutate the set of look-around (both behind and ahead) assertions that appear at least once in this state’s set of NFA states.
sourcefn add_match_pattern_id(&mut self, pid: PatternID)
fn add_match_pattern_id(&mut self, pid: PatternID)
Add a pattern ID to this state. All match states must have at least one pattern ID associated with it.
Callers must never add duplicative pattern IDs.
The order in which patterns are added must correspond to the order in which patterns are reported as matches.
sourcefn close_match_pattern_ids(&mut self)
fn close_match_pattern_ids(&mut self)
Indicate that no more pattern IDs will be added to this state.
Once this is called, callers must not call it or ‘add_match_pattern_id’ again.
This should not be exposed explicitly outside of this module. It should be called only when converting a StateBuilderMatches into a StateBuilderNFA.
sourcefn add_nfa_state_id(&mut self, prev: &mut StateID, sid: StateID)
fn add_nfa_state_id(&mut self, prev: &mut StateID, sid: StateID)
Add an NFA state ID to this state. The order in which NFA states are added matters. It is the caller’s responsibility to ensure that duplicate NFA state IDs are not added.