pub struct VcsState {
pub version: u32,
pub identities: Vec<Identity>,
pub sessions: Vec<Session>,
pub session_identities: BTreeMap<SessionToken, String>,
pub preserved: Vec<Recoverable>,
pub closed_sessions: BTreeSet<SessionToken>,
pub policy: Option<MergePolicy>,
pub publications: Vec<Publication>,
}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: u32The schema version this state was written at. A document that names none is the one this build writes.
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.
closed_sessions: BTreeSet<SessionToken>The sessions that have been closed. Every other session here is open.
One way to say closed rather than two, so a scenario written by hand names only the sessions whose lifecycle is not the one they were opened in.
policy: Option<MergePolicy>The policy this provider publishes under.
The answer a rules file gives the real implementation, which a provider has
none of — so a journey states it, and unset is the policy the contract’s own
default: names (DEFAULT_PUBLICATION). A
per-run policy narrows it through MergePolicy::narrow, which is the
rules system’s rule rather than a restatement of it here.
publications: Vec<Publication>Every publication this provider performed, in the order it performed them.
Both a record a journey asserts on and the answer to “has this session been published already”: a second publication of a session that landed has nothing the base does not already carry, which is what the real implementation reports for the same reason.
Trait Implementations§
Source§impl Checked for VcsState
A seeded repository side is refused if it holds a session nothing could act on.
impl Checked for VcsState
A seeded repository side is refused if it holds a session nothing could act on.
Source§impl Default for VcsState
A repository side that knows nothing, at the version this build writes.
impl Default for VcsState
A repository side that knows nothing, at the version this build writes.