pub struct RuleSet {
pub name: String,
/* private fields */
}Expand description
A named collection of rules with per-rule configuration.
Fields§
§name: StringDisplay name (e.g. “default”, “strict”, “nextjs”).
Implementations§
Source§impl RuleSet
impl RuleSet
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a rule set pre-loaded with all builtin rules.
Sourcepub fn configure(&mut self, rule_id: impl Into<String>, config: RuleConfig)
pub fn configure(&mut self, rule_id: impl Into<String>, config: RuleConfig)
Set config for a specific rule by ID.
Sourcepub fn set_enabled(&mut self, rule_id: &str, enabled: bool)
pub fn set_enabled(&mut self, rule_id: &str, enabled: bool)
Enable or disable a rule by ID.
Sourcepub fn effective_config(&self, rule_id: &str) -> RuleConfig
pub fn effective_config(&self, rule_id: &str) -> RuleConfig
Get the effective config for a rule (default if not overridden).
Sourcepub fn check_all(&self, ctx: &RuleContext<'_>) -> Vec<RuleResult>
pub fn check_all(&self, ctx: &RuleContext<'_>) -> Vec<RuleResult>
Run all enabled rules and collect results with metadata.
Sourcepub fn evaluate(&self, ctx: &RuleContext<'_>) -> Vec<RuleViolation>
pub fn evaluate(&self, ctx: &RuleContext<'_>) -> Vec<RuleViolation>
Run all enabled rules and collect violations (flat list, sorted by severity).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleSet
impl !RefUnwindSafe for RuleSet
impl Send for RuleSet
impl Sync for RuleSet
impl Unpin for RuleSet
impl UnsafeUnpin for RuleSet
impl !UnwindSafe for RuleSet
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more