pub struct FindingIdFilter { /* private fields */ }Expand description
A validated --finding-id request: the ids a run reports, in request order.
The filter runs after every other filter and after the baseline, so it narrows what the run would otherwise report. The ids themselves are stamped on the full result set before any filter, so a filter never changes them.
Implementations§
Source§impl FindingIdFilter
impl FindingIdFilter
Sourcepub fn parse<S: AsRef<str>>(values: &[S]) -> Result<Option<Self>, String>
pub fn parse<S: AsRef<str>>(values: &[S]) -> Result<Option<Self>, String>
Validate the requested ids and drop duplicates. Returns Ok(None)
when values is empty.
§Errors
Returns a message that names the first value that is not a current
dead-code finding id (dc1:<rule>:<16 hex digits> with an optional
~<k> suffix). A typo must never read as “the finding is gone”.
Sourcepub fn present(&self, results: &mut AnalysisResults) -> FxHashSet<String>
pub fn present(&self, results: &mut AnalysisResults) -> FxHashSet<String>
The requested ids that a finding in results carries. Reads only.
Sourcepub fn apply(
&self,
results: &mut AnalysisResults,
config: &ResolvedConfig,
filtered: &FxHashSet<String>,
run_reasons: impl IntoIterator<Item = FindingIdQueryReason>,
) -> FindingIdQuery
pub fn apply( &self, results: &mut AnalysisResults, config: &ResolvedConfig, filtered: &FxHashSet<String>, run_reasons: impl IntoIterator<Item = FindingIdQueryReason>, ) -> FindingIdQuery
Keep only the requested findings and build the query answer.
filtered holds the requested ids that the analysis found and a filter
of this run removed. run_reasons are the options of this run that
can hide a finding without a fix. rule-off is added when the rule of
a missing id is off in config.
Trait Implementations§
Source§impl Clone for FindingIdFilter
impl Clone for FindingIdFilter
Source§impl Debug for FindingIdFilter
impl Debug for FindingIdFilter
impl Eq for FindingIdFilter
Source§impl PartialEq for FindingIdFilter
impl PartialEq for FindingIdFilter
impl StructuralPartialEq for FindingIdFilter
Auto Trait Implementations§
impl Freeze for FindingIdFilter
impl RefUnwindSafe for FindingIdFilter
impl Send for FindingIdFilter
impl Sync for FindingIdFilter
impl Unpin for FindingIdFilter
impl UnsafeUnpin for FindingIdFilter
impl UnwindSafe for FindingIdFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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