pub struct DependencyOutcomes(/* private fields */);Expand description
Normalized-package-name -> DependencyOutcome map.
A newtype rather than a bare HashMap so the empty-entry pruning invariant (an entry is
removed once all three of its channels are cleared) lives in one place, and so test
fixtures get chainable with_* constructors instead of building three ad-hoc HashMaps.
Mirrors the existing crate::osv::VulnerabilityMap convention of a String-keyed map by
normalized name.
Implementations§
Source§impl DependencyOutcomes
impl DependencyOutcomes
Sourcepub fn get(&self, name: &str) -> Option<&DependencyOutcome>
pub fn get(&self, name: &str) -> Option<&DependencyOutcome>
Looks up the full outcome recorded for name.
Sourcepub fn yanked(&self, name: &str) -> Option<&(ConcreteVersion, RemovalStatus)>
pub fn yanked(&self, name: &str) -> Option<&(ConcreteVersion, RemovalStatus)>
Looks up the yanked-version finding for name.
Sourcepub fn deprecation(&self, name: &str) -> Option<&Deprecation>
pub fn deprecation(&self, name: &str) -> Option<&Deprecation>
Looks up the package-level deprecation finding for name.
Sourcepub fn fetch_failure(&self, name: &str) -> Option<&FetchFailure>
pub fn fetch_failure(&self, name: &str) -> Option<&FetchFailure>
Looks up the fetch-failure finding for name.
Sourcepub fn no_comparable_versions(&self, name: &str) -> bool
pub fn no_comparable_versions(&self, name: &str) -> bool
True when the registry fetch for name succeeded but produced zero comparable
versions (#550). See DependencyOutcome::no_comparable_versions.
Sourcepub fn set_yanked(
&mut self,
name: String,
yanked: (ConcreteVersion, RemovalStatus),
)
pub fn set_yanked( &mut self, name: String, yanked: (ConcreteVersion, RemovalStatus), )
Records a yanked-version finding for name, creating the entry if absent.
Sourcepub fn set_deprecation(&mut self, name: String, deprecation: Deprecation)
pub fn set_deprecation(&mut self, name: String, deprecation: Deprecation)
Records a package-level deprecation finding for name, creating the entry if absent.
Sourcepub fn set_fetch_failure(&mut self, name: String, failure: FetchFailure)
pub fn set_fetch_failure(&mut self, name: String, failure: FetchFailure)
Records a fetch-failure finding for name, creating the entry if absent.
Sourcepub fn set_fetch_failure_if_absent(
&mut self,
name: String,
failure: FetchFailure,
)
pub fn set_fetch_failure_if_absent( &mut self, name: String, failure: FetchFailure, )
Records a fetch-failure finding for name only if one is not already recorded,
creating the entry if absent.
Sourcepub fn set_no_comparable_versions(&mut self, name: String)
pub fn set_no_comparable_versions(&mut self, name: String)
Records that name’s registry fetch succeeded but produced zero comparable
versions (#550), creating the entry if absent.
Sourcepub fn clear_no_comparable_versions(&mut self, name: &str)
pub fn clear_no_comparable_versions(&mut self, name: &str)
Clears the no-comparable-versions channel for name, pruning the entry if it
becomes empty.
Sourcepub fn clear_yanked(&mut self, name: &str)
pub fn clear_yanked(&mut self, name: &str)
Clears the yanked-version channel for name, pruning the entry if it becomes empty.
Sourcepub fn clear_deprecation(&mut self, name: &str)
pub fn clear_deprecation(&mut self, name: &str)
Clears the deprecation channel for name, pruning the entry if it becomes empty.
Sourcepub fn clear_fetch_failure(&mut self, name: &str)
pub fn clear_fetch_failure(&mut self, name: &str)
Clears the fetch-failure channel for name, pruning the entry if it becomes empty.
Sourcepub fn remove(&mut self, name: &str)
pub fn remove(&mut self, name: &str)
Removes the whole entry for name, regardless of which channels are set.
Sourcepub fn clear_all_fetch_failures(&mut self)
pub fn clear_all_fetch_failures(&mut self)
Clears the fetch-failure channel for every entry, pruning any that become empty.
Used when a forced re-fetch (e.g. a live-reloaded registry-routing setting, deps-lsp issue #592) makes every previously recorded fetch-failure finding untrustworthy: the routing itself changed, so a failure recorded under the old routing must not survive to be merged with results fetched under the new one.
Sourcepub fn yanked_count(&self) -> usize
pub fn yanked_count(&self) -> usize
Number of entries with a yanked-version finding, for logging/Debug.
Sourcepub fn deprecation_count(&self) -> usize
pub fn deprecation_count(&self) -> usize
Number of entries with a deprecation finding, for logging/Debug.
Sourcepub fn fetch_failure_count(&self) -> usize
pub fn fetch_failure_count(&self) -> usize
Number of entries with a fetch-failure finding, for logging/Debug.
Sourcepub fn with_yanked(
self,
name: impl Into<String>,
yanked: (ConcreteVersion, RemovalStatus),
) -> Self
pub fn with_yanked( self, name: impl Into<String>, yanked: (ConcreteVersion, RemovalStatus), ) -> Self
Chainable builder recording a yanked-version finding. Test/fixture ergonomics.
Sourcepub fn with_deprecation(
self,
name: impl Into<String>,
deprecation: Deprecation,
) -> Self
pub fn with_deprecation( self, name: impl Into<String>, deprecation: Deprecation, ) -> Self
Chainable builder recording a package-level deprecation finding. Test/fixture ergonomics.
Sourcepub fn with_fetch_failure(
self,
name: impl Into<String>,
failure: FetchFailure,
) -> Self
pub fn with_fetch_failure( self, name: impl Into<String>, failure: FetchFailure, ) -> Self
Chainable builder recording a fetch-failure finding. Test/fixture ergonomics.
Sourcepub fn with_no_comparable_versions(self, name: impl Into<String>) -> Self
pub fn with_no_comparable_versions(self, name: impl Into<String>) -> Self
Chainable builder recording a no-comparable-versions finding (#550). Test/fixture ergonomics.
Trait Implementations§
Source§impl Clone for DependencyOutcomes
impl Clone for DependencyOutcomes
Source§fn clone(&self) -> DependencyOutcomes
fn clone(&self) -> DependencyOutcomes
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 DependencyOutcomes
impl Debug for DependencyOutcomes
Source§impl Default for DependencyOutcomes
impl Default for DependencyOutcomes
Source§fn default() -> DependencyOutcomes
fn default() -> DependencyOutcomes
Source§impl PartialEq for DependencyOutcomes
impl PartialEq for DependencyOutcomes
Source§fn eq(&self, other: &DependencyOutcomes) -> bool
fn eq(&self, other: &DependencyOutcomes) -> bool
self and other values to be equal, and is used by ==.