pub struct FilterRule {
pub pattern: String,
pub is_regex: bool,
pub case_sensitive: bool,
pub action: FilterAction,
pub category: Option<String>,
pub description: Option<String>,
}Expand description
A filter rule definition
Fields§
§pattern: StringThe pattern or keyword to match
is_regex: boolWhether this is a regex pattern
case_sensitive: boolCase-sensitive matching
action: FilterActionAction to take when matched
category: Option<String>Optional category for grouping
description: Option<String>Optional description
Implementations§
Source§impl FilterRule
impl FilterRule
Sourcepub fn keyword(pattern: impl Into<String>, action: FilterAction) -> Self
pub fn keyword(pattern: impl Into<String>, action: FilterAction) -> Self
Create a simple keyword rule
Sourcepub fn regex(pattern: impl Into<String>, action: FilterAction) -> Self
pub fn regex(pattern: impl Into<String>, action: FilterAction) -> Self
Create a regex pattern rule
Sourcepub fn case_sensitive(self, sensitive: bool) -> Self
pub fn case_sensitive(self, sensitive: bool) -> Self
Set case sensitivity
Sourcepub fn with_category(self, category: impl Into<String>) -> Self
pub fn with_category(self, category: impl Into<String>) -> Self
Set category
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set description
Trait Implementations§
Source§impl Clone for FilterRule
impl Clone for FilterRule
Source§fn clone(&self) -> FilterRule
fn clone(&self) -> FilterRule
Returns a duplicate of the value. Read more
1.0.0 · 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 FilterRule
impl Debug for FilterRule
Source§impl<'de> Deserialize<'de> for FilterRule
impl<'de> Deserialize<'de> for FilterRule
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 FilterRule
impl RefUnwindSafe for FilterRule
impl Send for FilterRule
impl Sync for FilterRule
impl Unpin for FilterRule
impl UnwindSafe for FilterRule
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