pub trait OptimizationRule: Send + Sync {
// Required methods
fn code(&self) -> &'static str;
fn description(&self) -> &'static str;
fn default_severity(&self) -> Severity;
fn check(
&self,
ctx: &RuleContext,
config: &K8sOptimizeConfig,
) -> Option<ResourceRecommendation>;
}Expand description
Trait for optimization rules.
Required Methods§
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Get the rule description.
Sourcefn default_severity(&self) -> Severity
fn default_severity(&self) -> Severity
Get the default severity for this rule.
Sourcefn check(
&self,
ctx: &RuleContext,
config: &K8sOptimizeConfig,
) -> Option<ResourceRecommendation>
fn check( &self, ctx: &RuleContext, config: &K8sOptimizeConfig, ) -> Option<ResourceRecommendation>
Check if this rule applies and generate a recommendation if so.