pub struct FilterConfig {
pub include: RuleFilterConfig,
pub exclude: RuleFilterConfig,
/* private fields */
}Expand description
Include/exclude filter configuration for diagnostics.
If include filters are non-empty, a diagnostic must match at least one. Any diagnostic matching an exclude filter is removed regardless.
Fields§
§include: RuleFilterConfig§exclude: RuleFilterConfigImplementations§
Source§impl FilterConfig
impl FilterConfig
pub fn new(include: RuleFilterConfig, exclude: RuleFilterConfig) -> FilterConfig
pub fn is_empty(&self) -> bool
pub fn matches_rule( &self, rule_id: &str, category: Option<&str>, resource_id: Option<&str>, resource_type: Option<&str>, logical_id: Option<&str>, entity_type: Option<EntityType>, ) -> bool
pub fn excluded_categories(&self) -> HashSet<&str>
Sourcepub fn invalid_patterns(&self) -> Vec<String>
pub fn invalid_patterns(&self) -> Vec<String>
Every id_patterns entry (from either the include or exclude filter) that is not a valid
regular expression. Callers should surface these rather than let them be silently discarded:
a dropped include pattern in particular would otherwise filter out every diagnostic, because
the include set is treated as non-empty yet matches nothing.
Sourcepub fn globally_suppresses_builtin_rule(
&self,
rule_id: &str,
category: Option<&str>,
severity: Severity,
strict: bool,
severity_level: Severity,
) -> bool
pub fn globally_suppresses_builtin_rule( &self, rule_id: &str, category: Option<&str>, severity: Severity, strict: bool, severity_level: Severity, ) -> bool
Whether global filtering can prove, before any rule evaluation, that no diagnostic this built-in rule could emit will survive finalization - regardless of the resource, path, or entity it fires on. A rule proven globally unable to survive can skip its work entirely without changing the reported diagnostics, because finalization would have removed every one of its findings anyway.
Only dimensions that apply uniformly to every diagnostic of the rule are consulted: the minimum-severity gate (accounting for the strict promotion of Warn to Error) and the global include/exclude dimensions - exact ID, category, ID range, and ID regex. The scoped resource-id, logical-id, resource-type, and service dimensions can still admit the rule for some resource, so they never justify global suppression.
Trait Implementations§
Source§impl Clone for FilterConfig
impl Clone for FilterConfig
Source§fn clone(&self) -> FilterConfig
fn clone(&self) -> FilterConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FilterConfig
impl Debug for FilterConfig
Source§impl Default for FilterConfig
impl Default for FilterConfig
Source§fn default() -> FilterConfig
fn default() -> FilterConfig
Source§impl<'de> Deserialize<'de> for FilterConfig
impl<'de> Deserialize<'de> for FilterConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FilterConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FilterConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for FilterConfig
impl Serialize for FilterConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl !Freeze for FilterConfig
impl RefUnwindSafe for FilterConfig
impl Send for FilterConfig
impl Sync for FilterConfig
impl Unpin for FilterConfig
impl UnsafeUnpin for FilterConfig
impl UnwindSafe for FilterConfig
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer