pub enum CompiledPattern {
Fast(Regex),
Fancy(Regex),
}Expand description
A regex compiled from a CloudFormation constraint, backed by whichever engine could compile it.
The regex-crate variant is used for the common RE2-compatible case; the fancy-regex variant
handles lookaround/backreference patterns. Both expose a uniform CompiledPattern::is_match.
Variants§
Implementations§
Source§impl CompiledPattern
impl CompiledPattern
Sourcepub fn is_match(&self, text: &str) -> bool
pub fn is_match(&self, text: &str) -> bool
Whether text matches the pattern. A fancy-regex match that errors at runtime (e.g. its
backtrack limit is hit on adversarial input) is reported as non-matching rather than
propagating, mirroring the crate’s own fallible contract; such inputs are not real template
values and treating them as non-matching cannot mask a legitimate constraint violation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledPattern
impl RefUnwindSafe for CompiledPattern
impl Send for CompiledPattern
impl Sync for CompiledPattern
impl Unpin for CompiledPattern
impl UnsafeUnpin for CompiledPattern
impl UnwindSafe for CompiledPattern
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more