pub enum Outcome {
Applied {
edit: ManifestEdit,
target: ConcreteVersion,
},
Skipped {
reason: SkipReason,
target: Option<ConcreteVersion>,
},
RequiresLockfileUpdate {
target: ConcreteVersion,
},
Unfixable(UnfixableReason),
}Expand description
A dependency’s disposition within an UpdatePlan.
§The invalid state this makes unrepresentable (#1349, #1615)
Before this type carried ManifestEdit directly, PlannedUpdateItem stored outcome
and edit: Option<ManifestEdit> as two independent fields the caller had to keep in sync by
convention (#1349) — that combination made apply_plan report success (Ok(())) without
writing anything. edit was folded into Self::Applied to close that gap, but the
dependency’s target version stayed a second, independently settable field on
PlannedUpdateItem itself, which reopened the same class of bug: an Applied item with no
target. #1615 folds the target into each variant that actually carries one instead, so
Self::Applied with no target fails to compile:
use deps_cli::update::Outcome;
use deps_core::edit::ManifestEdit;
use deps_core::position::{Position, Range};
let outcome = Outcome::Applied {
edit: ManifestEdit {
range: Range::new(Position::new(0, 9), Position::new(0, 14)),
new_text: "1.2.0".to_string(),
},
};Variants§
Applied
A fix plan existed and its edit was written (or would be, under --dry-run).
Contributes to exit 0. Carries the edit and its target version — #1349/#1615: this
makes “applied, but no edit/target to write” unrepresentable, where separate
PlannedUpdateItem fields previously let them drift out of sync (apply_plan would
report success without writing anything).
Fields
edit: ManifestEditThe edit apply_plan writes.
target: ConcreteVersionThe version this edit moves the dependency to.
Skipped
Excluded from this run, for SkipReason.
Fields
reason: SkipReasonWhy this candidate was skipped.
target: Option<ConcreteVersion>The target version considered for this occurrence, when one was known — None when
no concrete target exists (an unplannable latest, an ignore-rule skip of an
OSV-blocked fallback, or — under --security-only — a not-requested item).
RequiresLockfileUpdate
(--security-only only) The dependency is Vulnerable, but its declared requirement
already admits the fix target, so no requirement-level edit exists — needs #1116.
Contributes to exit 1.
Fields
target: ConcreteVersionThe already-admitted fix target.
Unfixable(UnfixableReason)
(--security-only only) No verified fix could be written, for UnfixableReason.
Contributes to exit 1.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub const fn wire_token(&self) -> &'static str
pub const fn wire_token(&self) -> &'static str
The FR-021 wire token (--format json’s outcome field, and the table’s [..]
prefix): one of exactly applied / skipped / requires-lockfile-update /
unfixable — a SkipReason/UnfixableReason’s own detail is carried in
PlannedUpdateItem::reason instead, not folded into this token.
Sourcepub const fn target(&self) -> Option<&ConcreteVersion>
pub const fn target(&self) -> Option<&ConcreteVersion>
This outcome’s target version, when its variant carries one — the sole read path for a
dependency’s considered/applied target (#1615), used by PlannedUpdateItem::target and
every formatter.
Trait Implementations§
impl Eq for Outcome
Source§impl From<&Outcome> for OutcomeToken
impl From<&Outcome> for OutcomeToken
impl StructuralPartialEq for Outcome
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
impl UnwindSafe for Outcome
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.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