Struct regex::dfa::Transitions [−][src]
The transition table.
It is laid out in row-major order, with states as rows and byte class transitions as columns.
The transition table is responsible for producing valid StatePtrs. A
StatePtr points to the start of a particular row in this table. When
indexing to find the next state this allows us to avoid a multiplication
when computing an index into the table.
Fields
table: Vec<u32>
The table.
num_byte_classes: usize
The stride.
Methods
impl Transitions[src]
impl Transitionsfn new(num_byte_classes: usize) -> Transitions[src]
fn new(num_byte_classes: usize) -> TransitionsCreate a new transition table.
The number of byte classes corresponds to the stride. Every state will
have num_byte_classes slots for transitions.
fn num_states(&self) -> usize[src]
fn num_states(&self) -> usizeReturns the total number of states currently in this table.
fn add(&mut self) -> Option<u32>[src]
fn add(&mut self) -> Option<u32>Allocates room for one additional state and returns a pointer to it.
If there's no more room, None is returned.
fn clear(&mut self)[src]
fn clear(&mut self)Clears the table of all states.
fn set_next(&mut self, si: u32, cls: usize, next: u32)[src]
fn set_next(&mut self, si: u32, cls: usize, next: u32)Sets the transition from (si, cls) to next.
fn next(&self, si: u32, cls: usize) -> u32[src]
fn next(&self, si: u32, cls: usize) -> u32Returns the transition corresponding to (si, cls).
fn state_heap_size(&self) -> usize[src]
fn state_heap_size(&self) -> usizeThe heap size, in bytes, of a single state in the transition table.
unsafe fn next_unchecked(&self, si: u32, cls: usize) -> u32[src]
unsafe fn next_unchecked(&self, si: u32, cls: usize) -> u32Like next, but uses unchecked access and is therefore unsafe.
Trait Implementations
impl Clone for Transitions[src]
impl Clone for Transitionsfn clone(&self) -> Transitions[src]
fn clone(&self) -> TransitionsReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Transitions[src]
impl Debug for TransitionsAuto Trait Implementations
impl Send for Transitions
impl Send for Transitionsimpl Sync for Transitions
impl Sync for Transitions