pub struct DetectionRule {
pub id: String,
pub name: String,
pub threat_type: ThreatType,
pub base_level: ThreatLevel,
pub threshold: f32,
pub time_window_secs: u64,
pub enabled: bool,
pub description: String,
}Expand description
检测规则
Fields§
§id: String规则 ID
name: String规则名称
threat_type: ThreatType威胁类型
base_level: ThreatLevel基础威胁级别
threshold: f32触发阈值
time_window_secs: u64时间窗口(秒)
enabled: bool是否启用
description: String描述
Implementations§
Source§impl DetectionRule
impl DetectionRule
pub fn new( name: impl Into<String>, threat_type: ThreatType, base_level: ThreatLevel, ) -> Self
pub fn with_threshold(self, threshold: f32) -> Self
pub fn with_time_window(self, secs: u64) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for DetectionRule
impl Clone for DetectionRule
Source§fn clone(&self) -> DetectionRule
fn clone(&self) -> DetectionRule
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 DetectionRule
impl Debug for DetectionRule
Source§impl<'de> Deserialize<'de> for DetectionRule
impl<'de> Deserialize<'de> for DetectionRule
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 DetectionRule
impl RefUnwindSafe for DetectionRule
impl Send for DetectionRule
impl Sync for DetectionRule
impl Unpin for DetectionRule
impl UnsafeUnpin for DetectionRule
impl UnwindSafe for DetectionRule
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