pub enum ScanDecision<'s, T>where
T: Default,{
Exclude(Option<Cow<'s, str>>),
Include(T),
}Expand description
Enum representing the decision state for filters and detections.
Variants§
Exclude(Option<Cow<'s, str>>)
Exclude decision variant.
When a component is excluded, it may optionally include the name of the excluding rule.
Include(T)
Include decision variant.
When a component is included, this variant contains data containing inclusion information.
Implementations§
Source§impl<'s, T> ScanDecision<'s, T>where
T: Default,
impl<'s, T> ScanDecision<'s, T>where
T: Default,
Sourcepub fn take_include(self) -> Option<T>
pub fn take_include(self) -> Option<T>
Consumes the decision and returns the included data if this is an Include variant.
Returns None if this is an Exclude variant. This method consumes self,
transferring ownership of the included data to the caller.
Sourcepub fn get_include(&self) -> Option<&T>
pub fn get_include(&self) -> Option<&T>
Returns a reference to the included data if this is an Include variant.
Returns None if this is an Exclude variant. This is a non-consuming
method that provides borrowed access to the included data.
Sourcepub fn get_exclude(&self) -> Option<&Option<Cow<'_, str>>>
pub fn get_exclude(&self) -> Option<&Option<Cow<'_, str>>>
Returns a reference to the exclude reason if this is an Exclude variant.
Returns None if this is an Include variant. The returned value is
an Option<&Option<Cow<'_, str>>> representing the optional exclusion rule.
Sourcepub fn is_include(&self) -> bool
pub fn is_include(&self) -> bool
Returns true if this is an Include variant.
Sourcepub fn is_exclude(&self) -> bool
pub fn is_exclude(&self) -> bool
Returns true if this is an Exclude variant.
Sourcepub fn is_default_exclude(&self) -> bool
pub fn is_default_exclude(&self) -> bool
Returns true if this is an Exclude variant with no specific rule.
This indicates a default exclusion where Exclude(None) was used,
distinguishing it from exclusions from a specific exclusion rule.