Skip to main content

UpdateRecovery

Enum UpdateRecovery 

pub enum UpdateRecovery {
    Nothing,
    Swept {
        removed: usize,
        kept: Vec<(PathBuf, String)>,
    },
    Restored {
        kept: Vec<(PathBuf, String)>,
    },
    Ambiguous {
        displaced: Vec<PathBuf>,
        kept: Vec<(PathBuf, String)>,
    },
    Occupied {
        displaced: PathBuf,
        occupant: PathBuf,
        kept: Vec<(PathBuf, String)>,
    },
    Displaced {
        displaced: Vec<PathBuf>,
        kept: Vec<(PathBuf, String)>,
    },
}
Expand description

What PluginHost::recover_interrupted_update found for one package.

Every outcome but Nothing carries kept: the generations marked for deletion that recovery found and could not delete, each with where it was left and why. UpdateRecovery::kept returns them whatever else recovery did.

Variants§

§

Nothing

There was nothing to put back or delete. Abandoned stages and empty transactions may have been cleared.

§

Swept

Out-of-date generations earlier updates claimed, or marked for deletion, were found. removed were deleted. kept could not be, each with where it was left and why: a generation marked for deletion is never loaded or put back, while one whose marking failed is still a claim.

Fields

§removed: usize
§kept: Vec<(PathBuf, String)>
§

Restored

The package was missing, and the one generation an interrupted update claimed was put back and discovery ran again. The configured policy decides whether it is admitted; PluginHost::get_plugin says whether it was.

Fields

§kept: Vec<(PathBuf, String)>
§

Ambiguous

The package is missing and more than one interrupted update claimed a generation of it, so which was installed last is not known. Nothing was moved.

Fields

§displaced: Vec<PathBuf>
§kept: Vec<(PathBuf, String)>
§

Occupied

The package is not loaded, but something already occupies its name, so the claimed generation was not moved onto it.

Fields

§displaced: PathBuf
§occupant: PathBuf
§kept: Vec<(PathBuf, String)>
§

Displaced

PluginHost::sweep_interrupted_update found the package missing and a generation of it that an interrupted update claimed, and left the claim where it is: only recovering the package by name puts it back.

Fields

§displaced: Vec<PathBuf>
§kept: Vec<(PathBuf, String)>

Implementations§

Source§

impl UpdateRecovery

Source

pub fn kept(&self) -> &[(PathBuf, String)]

The generations marked for deletion that recovery found and could not delete, whatever else it did: each with where it was left and why.

Trait Implementations§

Source§

impl Debug for UpdateRecovery

Source§

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

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

impl Eq for UpdateRecovery

Source§

impl PartialEq for UpdateRecovery

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UpdateRecovery

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

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

§

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.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

§

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
§

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

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