pub struct Pattern {
pub id: String,
pub pattern: String,
pub is_regex: bool,
pub severity: Severity,
pub category: String,
pub description: String,
pub case_insensitive: bool,
}Expand description
A pattern definition for matching
Fields§
§id: StringPattern identifier
pattern: StringThe pattern string (literal or regex)
is_regex: boolWhether this is a regex pattern
severity: SeveritySeverity of matches
category: StringCategory for this pattern
description: StringDescription of what this pattern detects
case_insensitive: boolWhether pattern matching should be case-insensitive
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub fn literal(id: impl Into<String>, pattern: impl Into<String>) -> Self
pub fn literal(id: impl Into<String>, pattern: impl Into<String>) -> Self
Create a new literal pattern
Sourcepub fn regex(id: impl Into<String>, pattern: impl Into<String>) -> Self
pub fn regex(id: impl Into<String>, pattern: impl Into<String>) -> Self
Create a new regex pattern
Sourcepub fn with_severity(self, severity: Severity) -> Self
pub fn with_severity(self, severity: Severity) -> Self
Set the severity
Sourcepub fn with_category(self, category: impl Into<String>) -> Self
pub fn with_category(self, category: impl Into<String>) -> Self
Set the category
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description
Sourcepub fn case_sensitive(self) -> Self
pub fn case_sensitive(self) -> Self
Set case sensitivity
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pattern
impl<'de> Deserialize<'de> for Pattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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