pub struct BehaviorRule {
pub rule_type: String,
pub threshold: u32,
pub window: u64,
pub pattern: String,
pub action: String,
pub ban_duration: Option<u64>,
pub correlate_with_detection: bool,
}Expand description
The reference BehaviorRule, field for field.
Only return_pattern rules are tracked today, like the go port;
usage and frequency rules construct but the caller drives them.
Fields§
§rule_type: Stringusage, return_pattern, or frequency.
threshold: u32§window: u64Sliding-window size in seconds.
pattern: Stringstatus:<code>, json:<path>==<expected>, regex:<pattern>, or a
bare (case-insensitive) substring.
action: Stringban, log, throttle, or alert.
ban_duration: Option<u64>The ban length override for the ban action; None falls back to
the reference 3600s default.
correlate_with_detection: boolThe reference correlate_with_detection: halves the effective
threshold while the caller reports live detection categories for
the IP (not modeled yet, matching the go port’s fail-closed note).
Trait Implementations§
Source§impl Clone for BehaviorRule
impl Clone for BehaviorRule
Source§impl Debug for BehaviorRule
impl Debug for BehaviorRule
impl Eq for BehaviorRule
Source§impl PartialEq for BehaviorRule
impl PartialEq for BehaviorRule
impl StructuralPartialEq for BehaviorRule
Auto Trait Implementations§
impl Freeze for BehaviorRule
impl RefUnwindSafe for BehaviorRule
impl Send for BehaviorRule
impl Sync for BehaviorRule
impl Unpin for BehaviorRule
impl UnsafeUnpin for BehaviorRule
impl UnwindSafe for BehaviorRule
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.