# Trait aho_corasick::Transitions [−] [src]

    pub trait Transitions {
        fn new(depth: u32) -> Self;
        fn goto(&self, alpha: u8) -> StateIdx;
        fn set_goto(&mut self, alpha: u8, si: StateIdx);
        fn heap_bytes(&self) -> usize;
    }

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.

## Implementors

- `impl Transitions for Dense`
- `impl Transitions for Sparse`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)