[−][src]Trait aho_corasick::Transitions
An abstraction over state transition strategies.
This is an attempt to let the caller choose the space/time trade offs used for state transitions.
(It's possible that this interface is merely good enough for just the two implementations in this crate.)
Required methods
fn new(depth: u32) -> Self
Return a new state at the given depth.
fn goto(&self, alpha: u8) -> StateIdx
Return the next state index given the next character.
fn set_goto(&mut self, alpha: u8, si: StateIdx)
Set the next state index for the character given.
fn heap_bytes(&self) -> usize
The memory use in bytes (on the heap) of this set of transitions.
Provided methods
fn for_each_transition<F>(&self, f: F) where
F: FnMut(u8, StateIdx),
F: FnMut(u8, StateIdx),
Iterates over each state
fn for_each_ok_transition<F>(&self, f: F) where
F: FnMut(u8, StateIdx),
F: FnMut(u8, StateIdx),
Iterates over each non-fail state
Implementors
impl Transitions for Dense
[src]
fn new(depth: u32) -> Dense
[src]
fn goto(&self, b1: u8) -> StateIdx
[src]
fn set_goto(&mut self, b: u8, si: StateIdx)
[src]
fn heap_bytes(&self) -> usize
[src]
fn for_each_transition<F>(&self, f: F) where
F: FnMut(u8, StateIdx),
[src]
F: FnMut(u8, StateIdx),
fn for_each_ok_transition<F>(&self, f: F) where
F: FnMut(u8, StateIdx),
[src]
F: FnMut(u8, StateIdx),
impl Transitions for Sparse
[src]
fn new(_: u32) -> Sparse
[src]
fn goto(&self, b: u8) -> StateIdx
[src]
fn set_goto(&mut self, b: u8, si: StateIdx)
[src]
fn heap_bytes(&self) -> usize
[src]
fn for_each_transition<F>(&self, f: F) where
F: FnMut(u8, StateIdx),
[src]
F: FnMut(u8, StateIdx),
fn for_each_ok_transition<F>(&self, f: F) where
F: FnMut(u8, StateIdx),
[src]
F: FnMut(u8, StateIdx),