Skip to main content

compile

Function compile 

Source
pub fn compile(pattern: &str) -> Option<Arc<CompiledPattern>>
Expand description

Compile a CloudFormation pattern/AllowedPattern string, preserving its matched language.

The result is memoized: each distinct pattern is compiled once and the shared CompiledPattern is returned on subsequent calls. Returns None only when the pattern cannot be made to compile by any strategy - which, for the schemas shipped in this crate’s consumers, does not occur (enforced by a corpus test). Callers treat None as “constraint could not be enforced” and must not silently accept the value.