pub enum RuleCondition {
Regex {
pattern: String,
},
SectionContains {
section: String,
values: Vec<String>,
},
SectionRegex {
section: String,
pattern: String,
},
ArtifactKind {
kinds: Vec<ArtifactKind>,
},
Any(Vec<RuleCondition>),
All(Vec<RuleCondition>),
CodeLanguage {
languages: Vec<String>,
},
}Expand description
Condition for rule matching
Conditions define when a rule should trigger. Multiple condition types
are supported, and conditions can be combined using Any or All.
Variants§
Regex
Match a regex pattern
SectionContains
Match content in a specific section
SectionRegex
Match a regex within a specific section
ArtifactKind
Restrict the rule to a specific artifact class
Fields
§
kinds: Vec<ArtifactKind>Any(Vec<RuleCondition>)
Any of the conditions must match
All(Vec<RuleCondition>)
All conditions must match
CodeLanguage
Match specific code block languages
Trait Implementations§
Source§impl Clone for RuleCondition
impl Clone for RuleCondition
Source§fn clone(&self) -> RuleCondition
fn clone(&self) -> RuleCondition
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 RuleCondition
impl Debug for RuleCondition
Source§impl<'de> Deserialize<'de> for RuleCondition
impl<'de> Deserialize<'de> for RuleCondition
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 RuleCondition
impl RefUnwindSafe for RuleCondition
impl Send for RuleCondition
impl Sync for RuleCondition
impl Unpin for RuleCondition
impl UnsafeUnpin for RuleCondition
impl UnwindSafe for RuleCondition
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