pub struct VcsState {
pub version: u32,
pub identities: Vec<Identity>,
pub sessions: Vec<Session>,
pub session_identities: BTreeMap<SessionToken, String>,
pub session_labels: BTreeMap<SessionToken, BTreeMap<String, 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.
session_labels: BTreeMap<SessionToken, BTreeMap<String, String>>The labels each session was opened with, for the sessions opened with any.
Keyed by token the way session_identities is,
and for the same reason: a Session carries no labels, and both session holders and every recoverable row report them. open_session records
them; 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§fn carry_forward(&mut self)
fn carry_forward(&mut self)
Every field an older readable document could hold means here what it meant there, and the two the repository side gained in version 4 are absent from one written before them — which is the answer, since that build held no hold and counted no lines.
Version 5’s field is the exception, and it is carried rather than left at its
default: a document written before it listed preserved work nobody had
published, which is the no this build spells out. Left at the default it
would read as “nothing here can say”, and a consumer’s checked-in scenario
would start reporting work it had always called unpublished as work that may
have landed.
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.