Skip to main content

Repository

Struct Repository 

Source
pub struct Repository<T> { /* private fields */ }
Expand description

The repository side of a run, over whichever store holds its state.

The two flavours below are this one behaviour with a different store under it, so neither can learn something the other does not know.

Implementations§

Source§

impl Repository<MemoryStore<VcsState>>

Source

pub fn new() -> Self

A repository provider knowing nothing.

Source

pub fn seeded(state: VcsState) -> Self

A repository provider that starts from a scenario.

Source

pub fn state(&self) -> VcsState

Everything it knows.

Source§

impl Repository<FileStore<VcsState>>

Source

pub fn create(path: impl Into<PathBuf>) -> Result<Self>

A repository provider keeping its state at path: whatever is already there, or nothing.

Attaching rather than replacing, so a second provider over the same path picks up what the first one left — which is what a journey driving several invocations reaches for this flavour to get.

Source

pub fn seeded(path: impl Into<PathBuf>, state: VcsState) -> Result<Self>

A repository provider that starts from a scenario, keeping its state at path and replacing whatever was there.

Source

pub fn state(&self) -> Result<VcsState>

Everything it knows, read back out of its document.

Trait Implementations§

Source§

impl<T: Debug> Debug for Repository<T>

Source§

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

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

impl<T: Store<VcsState>> Vcs for Repository<T>

Source§

fn publish( &self, token: &SessionToken, request: &PublishRequest, hosting: &dyn Hosting, ) -> Result<Publication>

Publish a session’s branch, as far as a provider honestly can.

The host side is performed rather than described: a change request is really opened against the Hosting this was handed, really adopted when one is already open, and really merged under the policy — so the six host methods are exercised and what the host recorded is what a journey reads back.

The repository side is not, and none of it is claimed. There is no origin to fetch from, no tree to run a gate in, no push, and no lock to queue behind, so no fetch, gate-started, gate-verdict, push, lock-wait, lock-acquired, or merge-queued event is emitted. What is emitted is what was decided: the change that was opened, and the merge that landed.

Source§

fn resolve_identity(&self, origin_or_path: &str) -> Result<Identity>

Resolve an origin URL or a checkout path to the repository identity it belongs to.
Source§

fn open_session(&self, req: SessionRequest) -> Result<Session>

Open a session: a per-run clone of an execution checkout and an isolated worktree cut from it, held under an occupancy lease.
Source§

fn adopt_session(&self, token: SessionToken) -> Result<Session>

Re-attach to a session that already exists, claiming its free occupancy lease.
Source§

fn preserve( &self, s: &Session, provenance: Provenance, ) -> Result<PreservedBranch>

Commit the session’s work onto a branch that outlives it, recording why.
Source§

fn session(&self, token: &SessionToken) -> Result<SessionRecord>

What this implementation recorded about a session it opened.
Source§

fn close_session(&self, token: &SessionToken) -> Result<Session>

Release a session’s worktree and its lease, keeping its branch.
Source§

fn recoverable(&self, scope: Scope) -> Result<Vec<Recoverable>>

Every preserved-but-unpublished branch in scope, and what would land each.

Auto Trait Implementations§

§

impl<T> Freeze for Repository<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Repository<T>
where T: RefUnwindSafe,

§

impl<T> Send for Repository<T>
where T: Send,

§

impl<T> Sync for Repository<T>
where T: Sync,

§

impl<T> Unpin for Repository<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Repository<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Repository<T>
where T: UnwindSafe,

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