#[non_exhaustive]pub enum SkipReason {
NonRegistrySource,
NoConcreteVersion,
ResolvedTagNotFullVersion,
UnmappableName,
CanonicalNameUnconfirmed,
UnmappableEcosystem,
QueryFailed,
Truncated,
UnmatchableVersion,
UnevaluableAdvisoryRange,
}Expand description
Why a dependency produced no advisories.
Absence from VulnerabilityMap is never a synonym for “clean” — every
input to crate::osv::OsvClient::scan gets an entry, and every filtered-out or
failed path must declare itself as one of these reasons rather than
silently vanishing from the map (architecture.md §6, §8 invariant 0).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NonRegistrySource
dep.source() was not crate::parser::DependencySource::Registry (§3 step 0).
NoConcreteVersion
No lockfile-resolved or concrete version was available (§3 steps 1-3).
ResolvedTagNotFullVersion
A tag was resolved (e.g. a SHA pin’s hover **Resolved** line) but it is a moving
alias or a non-version name, not a full version OSV.dev can be queried with (#1668).
UnmappableName
EcosystemFormatter::osv_package_name returned None.
CanonicalNameUnconfirmed
The OSV package name depends on registry data (a repository’s canonical casing) that
has not been fetched yet, or could not be; retried once the ecosystem’s TagIndex
is populated.
UnmappableEcosystem
EcosystemId::osv_ecosystem returned None.
QueryFailed
The batch or single-package query failed (network error, non-2xx, malformed JSON, or a chunk whose result count did not match its query count).
Truncated
The batch result was truncated (next_page_token present) and the
bounded individual-requery budget was exhausted before this entry
could be recovered (§8 invariant 2).
UnmatchableVersion
The ecosystem is matched locally (OsvEcosystem::version_matching) and the in-use
version is not a full SemVer version (a floating v4 tag, a SHA pin, a branch).
UnevaluableAdvisoryRange
The ecosystem is matched locally and an advisory exists for the package, but its affected ranges could not be evaluated against the in-use version — possibly vulnerable.
Implementations§
Source§impl SkipReason
impl SkipReason
Sourcepub const fn unchecked_reason(self) -> Option<&'static str>
pub const fn unchecked_reason(self) -> Option<&'static str>
Human-readable clause explaining why vulnerability data was never checked,
for the hover footer and diagnostic notice that surface a ScanOutcome::Skipped
outcome to the user (issue #1392) — the single source of wording both call sites
share, so the two surfaces never drift into describing the same reason differently.
NonRegistrySource has no entry here: callers gate that case out themselves
(mirroring the pre-existing resolvable hover gate), since a source that is
never network-resolved under any setting was never going to be checked
regardless of this feature.
The two call sites apply different additional filtering on top of this method
(issue #1392 M1): deps-core::lsp_helpers::hover’s per-dependency, on-demand
footer shows every reason returned here, but
deps-core::lsp_helpers::diagnostics’s file-level, persistent Problems-panel
notice further excludes UnmappableName/UnmappableEcosystem — those are
structurally permanent for as long as a dependency is declared the way it is
(every jsr:-pinned dependency is UnmappableName forever, for example), so a
standing diagnostic for them would be unresolvable noise, unlike the transient/
environment-dependent NoConcreteVersion/QueryFailed/Truncated. Wording here
states only the fact, never a remedy (e.g. never “add a lock file to fix this”):
resolving a version does not itself re-run the OSV scan for an already-open
document, so promising that the message clears immediately would overclaim.
§Examples
use deps_core::osv::SkipReason;
assert_eq!(
SkipReason::NoConcreteVersion.unchecked_reason(),
Some("no resolved or exact version was available to query")
);
assert_eq!(
SkipReason::ResolvedTagNotFullVersion.unchecked_reason(),
Some("the resolved tag is not a full version, so it was not queried")
);
assert_eq!(SkipReason::NonRegistrySource.unchecked_reason(), None);Sourcepub const fn is_structural(self) -> bool
pub const fn is_structural(self) -> bool
Whether this reason is structural — permanent for as long as a dependency is declared the way it is (a mapping/ecosystem-support gap) — as opposed to transient (a timeout or a temporary OSV outage, which a retry could resolve).
Used by callers deciding whether a dependency whose “latest” was never checked (issue
#1517) should be treated as not-applicable (structural) or unverified/fail-closed
(transient) — a Self::QueryFailed/Self::Truncated/Self::NoConcreteVersion
skip must never be silently treated as “this dependency has no latest to verify”, since a
retry or a resolved lockfile could turn it into a real, checkable result later.
§Examples
use deps_core::osv::SkipReason;
assert!(SkipReason::UnmappableName.is_structural());
assert!(!SkipReason::QueryFailed.is_structural());Trait Implementations§
Source§impl Clone for SkipReason
impl Clone for SkipReason
impl Copy for SkipReason
Source§impl Debug for SkipReason
impl Debug for SkipReason
impl Eq for SkipReason
Source§impl From<StructuralSkipReason> for SkipReason
impl From<StructuralSkipReason> for SkipReason
Source§fn from(value: StructuralSkipReason) -> Self
fn from(value: StructuralSkipReason) -> Self
Source§impl PartialEq for SkipReason
impl PartialEq for SkipReason
impl StructuralPartialEq for SkipReason
Auto Trait Implementations§
impl Freeze for SkipReason
impl RefUnwindSafe for SkipReason
impl Send for SkipReason
impl Sync for SkipReason
impl Unpin for SkipReason
impl UnsafeUnpin for SkipReason
impl UnwindSafe for SkipReason
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§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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.