Skip to main content

Crate matchy_ac

Crate matchy_ac 

Source
Expand description

Offset-based Aho-Corasick Automaton

This module implements an Aho-Corasick automaton that builds directly into the binary offset-based format. Unlike traditional implementations, this creates the serialized format during construction, allowing zero-copy memory-mapped operation.

§Design

The automaton is stored as a single Vec<u8> containing:

  • AC nodes with offset-based transitions
  • Edge arrays referenced by nodes
  • Pattern ID arrays referenced by nodes

All operations (both building and matching) work directly on this buffer.

Re-exports§

pub use validation::validate_ac_reachability;
pub use validation::validate_ac_structure;
pub use validation::validate_pattern_references;
pub use validation::ACStats;
pub use validation::ACValidationResult;

Modules§

validation
AC Automaton validation for untrusted binary data

Structs§

ACAutomaton
Offset-based Aho-Corasick automaton for building
ACEdge
AC Edge (for sparse/dense states)
ACNodeHot
AC Node hot data (checked every transition)
DenseLookup
Dense lookup table (256 entries)

Enums§

ACError
Error type for AC automaton operations
MatchMode
Match mode for text matching operations.
StateKind
State encoding type