Skip to main content

load_precompiled

Function load_precompiled 

Source
pub fn load_precompiled(bytes: &[u8]) -> Result<RegexSet, LoadError>
Expand description

Re-exports the forbidden-regex rule compiler’s public surface. Loads a precompiled serialized RegexSet from bytes.

Wraps the engine’s from_bytes, which decodes and structurally validates the blob before it can match. The planning doc resolved that the builtin baseline is embedded precompiled at build time (runtime compilation is too slow); stage two performs the embedding, and this is the construction path it will use. A decode or validation failure becomes a redacted Precompiled error.