Skip to main content

Recoverable

Struct Recoverable 

Source
pub struct Recoverable {
    pub identity: String,
    pub branch: PreservedBranch,
    pub checkout: PathBuf,
    pub stopped_because: String,
    pub landed: Landed,
    pub recover_command: Vec<String>,
    pub held_by: Option<HeldBy>,
    pub net_negative: Option<NetNegative>,
    pub session: Option<SessionToken>,
    pub labels: BTreeMap<String, String>,
    pub on_origin: Option<OnOrigin>,
    pub retirement: Option<Retirement>,
}
Expand description

Preserved work, whether it reached its base, and what would land it.

Read through the conversion below, which is where the one thing this row could contradict itself about is settled: a row saying the work reached the base and carrying the argv that publishes it again does not deserialize at all. The row is read to be pasted, and the whole reason the answer is on it is that pasting one for finished work re-opens a change request for what the base has.

Fields§

§identity: String

The identity the work belongs to.

§branch: PreservedBranch

The branch and why it was preserved.

§checkout: PathBuf

The checkout the branch can be reached from.

§stopped_because: String

Why the workstream stopped.

§landed: Landed

Whether the work reached the base, and what says so.

The one field on this row that decides whether the row is an instruction at all: a row whose work reached the base carries no argv.

Written always and defaulted on the way in, so a stored document that predates the field reads back as the answer it gave: nothing said.

§recover_command: Vec<String>

The argv that lands it, ready to run.

Ready to run is a claim about the branch as much as about the argv, so it holds only where the two fields below say nothing: work a live session is still writing to has not stopped, and running this on it publishes a branch mid-flight.

Empty where nothing may be run, which is every row whose work reached the base: the argv would publish work that is already there. A row is read to be pasted, so the answer is the absence of a command rather than a command with a warning beside it.

§held_by: Option<HeldBy>

The live session still writing to this branch, when one is.

Present at all is the answer: this is not preserved work yet, and recover_command must not be run until that session is done with it. Absent — every row of a report about work that really did stop — and the row is exactly what it has always been.

§net_negative: Option<NetNegative>

What the branch would land, when it removes more lines than it adds.

A branch that deletes far more than it adds may be perfectly correct, and it is not something to publish unread — so it is marked rather than excluded, and marked only then: a branch that adds at least as much as it removes carries nothing here, and cannot, because NetNegative holds no such count.

§session: Option<SessionToken>

The session that answers for this branch: the newest record naming it — the end of its chain of retries, an open one preferred — or None where no record on this host names the branch at all, which is what a worktree-agent-* orphan left behind by nothing this crate opened reads as.

Written always, null included, so a reader routing on it meets the key on every row.

§labels: BTreeMap<String, String>

That session’s labels: what the caller that opened it said about who opened it. An empty object where the record carries none, and where session is None.

§on_origin: Option<OnOrigin>

Where onevcs preserve put this branch on its identity’s origin, when it has.

Additive, and absent for a branch nothing has preserved — which is every row of a report a consumer that predates the field reads. It changes nothing about recover_command: being on the origin under its own name is not being published, and the verb that lands the work is the verb that landed it before. That is the whole point of the verb being called preserve.

§retirement: Option<Retirement>

What the branch is for the question of whether it may be deleted — the classification onevcs retire and onevcs reclaim act on, made here from this host’s records and local refs alone, since this report never asks the host.

Additive: every row onevcs answers carries it, and a row an implementation that does not classify answered omits it, as a consumer that predates the field never meets it. A row whose class is retirable is not in the default report, as a row whose work landed is not.

Trait Implementations§

Source§

impl Clone for Recoverable

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 Recoverable

Source§

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

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

impl<'de> Deserialize<'de> for Recoverable

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Recoverable

Source§

impl PartialEq for Recoverable

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 Serialize for Recoverable

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Recoverable

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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