Skip to main content

FilterConfig

Struct FilterConfig 

Source
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: RuleFilterConfig

Implementations§

Source§

impl FilterConfig

Source

pub fn new(include: RuleFilterConfig, exclude: RuleFilterConfig) -> Self

Source

pub fn is_empty(&self) -> bool

Source

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

Source

pub fn excluded_categories(&self) -> HashSet<&str>

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilterConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FilterConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FilterConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FilterConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.