Skip to main content

UpgradeStatus

Enum UpgradeStatus 

Source
#[non_exhaustive]
pub enum UpgradeStatus { NotChecked, CandidateClean { version: ConcreteVersion, }, CandidateVulnerable { version: ConcreteVersion, advisory_ids: Capped<String>, worst_severity: Option<VulnSeverity>, }, CandidateUnverified { version: ConcreteVersion, reason: SkipReason, }, StructurallyUnchecked(StructuralSkipReason), }
Expand description

Result of checking whether a recommended upgrade target is itself affected.

Populated by crate::osv::OsvClient::check_candidates (phase B, issue #1517: now run for every dependency with a registry-cached latest, not only ones phase A already flagged ScanOutcome::Vulnerable). Used for both the registry’s “latest” candidate (the per-key entry in crate::osv::LatestStatusMap) and the independently-verified fix target F (DependencyVulnerabilities::fix_target_status) — see the latter’s doc for why F needs its own verification result distinct from latest’s.

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.
§

NotChecked

Phase B has not run for this dependency (phase A found nothing, or phase B has not completed yet).

§

CandidateClean

The candidate upgrade version is not itself affected by any known advisory.

Fields

§version: ConcreteVersion

The version that was checked.

§

CandidateVulnerable

The candidate upgrade version is itself affected.

Fields

§version: ConcreteVersion

The version that was checked.

§advisory_ids: Capped<String>

Advisory IDs that still apply to the candidate version, capped at crate::osv::MAX_ADVISORY_RECORDS the same way DependencyVulnerabilities::advisories is (#462 critic M1) — not necessarily exhaustive. Check Capped::is_complete before treating it as the complete set of advisories still affecting this candidate; an incomplete list means some are missing, not that none exist.

§worst_severity: Option<VulnSeverity>

The most severe VulnSeverity among advisory_ids’s full records, or None when no record could be fetched for any of them (issue #1517) — a caller must treat None as blocking (never render this candidate as safe), never as “no advisories”. Exists so an VulnSeverity::Informational-only advisory that affects every version of a dependency (common for RUSTSEC-style maintenance notices) does not wrongly suppress “outdated” status for that dependency’s latest — a caller checks this field before treating Self::CandidateVulnerable as a hard block.

§

CandidateUnverified

The candidate upgrade version’s OSV status could not be determined, but a version was still attempted or is otherwise known: either the check itself failed (transient — query failure, timeout, truncation) or the reason is structural but a real candidate version was already on hand (SkipReason::UnmappableName/SkipReason::UnmappableEcosystem — the registry’s “latest” is known, only its OSV mapping is not). See Self::StructurallyUnchecked for the case where no version is known at all. A caller must fail closed (never render this as “verified safe”) until a later phase B run replaces it — SkipReason::is_structural tells a transient reason apart from a structural-but-version-known one, which callers treat differently (issue #1517).

Fields

§version: ConcreteVersion

The version that was attempted.

§reason: SkipReason

Why the check did not produce a definite clean/vulnerable verdict.

§

StructurallyUnchecked(StructuralSkipReason)

This dependency’s source/ecosystem is never checked against OSV at all, and no candidate version is known either, so there is nothing to report — unlike Self::CandidateUnverified, which always names a version even when its reason is also structural. Only ever holds a StructuralSkipReason (issue #1624 S1): unlike a bare SkipReason, which also admits transient reasons like SkipReason::QueryFailed, this makes “this dependency is never checked, for a permanent reason” the only state this variant can represent — a caller (e.g. crate::lsp_helpers::latest_verdict) degrades it to “not applicable” rather than “unverified” (issue #1517).

Trait Implementations§

Source§

impl Clone for UpgradeStatus

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 Debug for UpgradeStatus

Source§

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

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

impl Eq for UpgradeStatus

Source§

impl PartialEq for UpgradeStatus

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 UpgradeStatus

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