Struct aho_corasick::util::special::Special
source · pub(crate) struct Special {
pub(crate) max_special_id: StateID,
pub(crate) max_match_id: StateID,
pub(crate) start_unanchored_id: StateID,
pub(crate) start_anchored_id: StateID,
}
Expand description
A collection of sentinel state IDs for Aho-Corasick automata.
This specifically enables the technique by which we determine which states are dead, matches or start states. Namely, by arranging states in a particular order, we can determine the type of a state simply by looking at its ID.
Fields§
§max_special_id: StateID
The maximum ID of all the “special” states. This corresponds either to start_anchored_id when a prefilter is active and max_match_id when a prefilter is not active. The idea here is that if there is no prefilter, then there is no point in treating start states as special.
max_match_id: StateID
The maximum ID of all the match states. Any state ID bigger than this is guaranteed to be a non-match ID.
It is possible and legal for max_match_id to be equal to start_anchored_id, which occurs precisely in the case where the empty string is a pattern that was added to the underlying automaton.
start_unanchored_id: StateID
The state ID of the start state used for unanchored searches.
start_anchored_id: StateID
The state ID of the start state used for anchored searches. This is always start_unanchored_id+1.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Special
impl RefUnwindSafe for Special
impl Send for Special
impl Sync for Special
impl Unpin for Special
impl UnwindSafe for Special
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
)