Skip to main content

VcsState

Struct VcsState 

Source
pub struct VcsState {
    pub version: u32,
    pub identities: Vec<Identity>,
    pub sessions: Vec<Session>,
    pub session_identities: BTreeMap<SessionToken, String>,
    pub preserved: Vec<Recoverable>,
}
Expand description

Everything the repository side of a run knows about itself.

Every field is public and serializable, so a journey both seeds a scenario and asserts on what a run left behind. Everything but the version is omitted when it holds nothing, so a hand-written document names only the part of a scenario that matters — and a document written by a build that knew fewer fields still reads here.

Fields§

§version: u32

The schema version this state was written at. A document that names none is this version: it is the only one there has ever been.

§identities: Vec<Identity>

The repository identities this provider can resolve. A SessionRequest::repo naming none of them is refused, the way an unregistered repository is.

§sessions: Vec<Session>

Every session opened or seeded, in the order they were opened.

§session_identities: BTreeMap<SessionToken, String>

Which identity each session belongs to.

Beyond the sketch this crate was specified from, and unavoidable: a Session carries no identity, and a Recoverable must name one — so preserving a session’s branch could not answer the question recoverable asks without this. open_session records it; nothing else writes it.

§preserved: Vec<Recoverable>

Preserved work, newest last, as recoverable reports it.

Recoverable rather than PreservedBranch — it contains the preserved branch and adds the identity, the checkout, why the workstream stopped, and the command that lands it, none of which are derivable from the branch alone. One list rather than two that could disagree.

Trait Implementations§

Source§

impl Checked for VcsState

A seeded repository side is refused if it holds a session nothing could act on.

Source§

fn check(&self) -> Result<()>

Refuse this state, naming what is wrong with it.
Source§

impl Clone for VcsState

Source§

fn clone(&self) -> VcsState

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 VcsState

Source§

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

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

impl Default for VcsState

A repository side that knows nothing, at the version this build writes.

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for VcsState

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

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

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

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