Skip to main content

SkipReason

Enum SkipReason 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

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);
Source

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

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 Copy for SkipReason

Source§

impl Debug for SkipReason

Source§

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

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

impl Eq for SkipReason

Source§

impl From<StructuralSkipReason> for SkipReason

Source§

fn from(value: StructuralSkipReason) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for SkipReason

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SkipReason

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more