Struct regex::dfa::Cache[][src]

pub struct Cache {
    inner: CacheInner,
    qcur: SparseSet,
    qnext: SparseSet,
}

A reusable cache of DFA states.

This cache is reused between multiple invocations of the same regex program. (It is not shared simultaneously between threads. If there is contention, then new caches are created.)

Fields

Group persistent DFA related cache state together. The sparse sets listed below are used as scratch space while computing uncached states.

qcur and qnext are ordered sets with constant time addition/membership/clearing-whole-set and linear time iteration. They are used to manage the sets of NFA states in DFA states when computing cached DFA states. In particular, the order of the NFA states matters for leftmost-first style matching. Namely, when computing a cached state, the set of NFA states stops growing as soon as the first Match instruction is observed.

Methods

impl Cache
[src]

Create new empty cache for the DFA engine.

Trait Implementations

impl Clone for Cache
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Cache
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Cache

impl Sync for Cache