pub struct PatternDef {
pub name: String,
pub regex: String,
pub category: String,
pub description: String,
pub is_suspicious: bool,
pub severity: u8,
}Expand description
Serializable pattern definition.
Fields§
§name: StringUnique identifier for the pattern.
regex: StringRegular expression source.
category: StringCategory assigned when the pattern matches.
description: StringHuman-readable explanation of the match.
is_suspicious: boolWhether a match contributes a suspicious indicator.
severity: u8Severity from 0 through 10 when suspicious.
Implementations§
Source§impl PatternDef
impl PatternDef
Sourcepub fn compile(self) -> AnalysisResult<Pattern>
pub fn compile(self) -> AnalysisResult<Pattern>
Validate and compile this definition.
Trait Implementations§
Source§impl Clone for PatternDef
impl Clone for PatternDef
Source§fn clone(&self) -> PatternDef
fn clone(&self) -> PatternDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PatternDef
impl Debug for PatternDef
Source§impl<'de> Deserialize<'de> for PatternDef
impl<'de> Deserialize<'de> for PatternDef
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
impl Eq for PatternDef
Source§impl PartialEq for PatternDef
impl PartialEq for PatternDef
Source§impl Serialize for PatternDef
impl Serialize for PatternDef
impl StructuralPartialEq for PatternDef
Auto Trait Implementations§
impl Freeze for PatternDef
impl RefUnwindSafe for PatternDef
impl Send for PatternDef
impl Sync for PatternDef
impl Unpin for PatternDef
impl UnsafeUnpin for PatternDef
impl UnwindSafe for PatternDef
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