Skip to main content

GitCompatRepository

Struct GitCompatRepository 

Source
pub struct GitCompatRepository<S> { /* private fields */ }
Expand description

Repository façade over one SDK workspace and private compatibility state.

Implementations§

Source§

impl<S> GitCompatRepository<S>

Source

pub const fn new(workspace_id: WorkspaceId, store: S) -> Self

Creates a façade. State is initialized lazily on the first command.

Source

pub const fn store(&self) -> &S

Borrows the state adapter.

Source§

impl<S: GitCompatStore> GitCompatRepository<S>

Source

pub async fn tracked_paths( &self, ) -> Result<BTreeSet<String>, GitCompatError<S::Error>>

Returns the paths tracked by the current compatibility branch.

Source

pub async fn head( &self, ) -> Result<Option<GitCommitId>, GitCompatError<S::Error>>

Returns the latest explicit compatibility commit for the current branch.

Source

pub async fn run<E: GitFilesystemExecutor, T: IntoGitTreeRef>( &self, command: GitCommand, workspace_tree: T, executor: &E, ) -> Result<GitCommandOutput, GitCompatRunError<S::Error, E::Error>>

Executes a command and all required filesystem work through one composed recovery-safe boundary.

Adapters normally need only this method. State-only commands return immediately, action commands receive a deterministic operation identity, and prepared sequencer mutations remain durable if the executor fails.

Source

pub async fn run_argv<E: GitFilesystemExecutor, T: IntoGitTreeRef>( &self, argv: &[String], workspace_tree: T, default_author: &str, now_seconds: i64, executor: &E, ) -> Result<GitCommandOutput, GitCompatRunError<S::Error, E::Error>>

Parses argv following the acyclic git umbrella subcommand and executes it through Self::run. This API never intercepts or invokes system git.

Source

pub async fn resume<E: GitFilesystemExecutor>( &self, executor: &E, ) -> Result<Option<GitCommandOutput>, GitCompatRunError<S::Error, E::Error>>

Recovers the durable pending transition, if any, through the same executor contract used by Self::run.

Source

pub async fn execute<T: IntoGitTreeRef>( &self, command: GitCommand, workspace_tree: T, ) -> Result<GitCommandOutput, GitCompatError<S::Error>>

Executes one typed command against an exact live workspace generation.

Source

pub async fn pending_transition( &self, ) -> Result<Option<GitPendingTransition>, GitCompatError<S::Error>>

Returns the durable sequencer transition that requires recovery.

Source

pub async fn complete_transition( &self, transition: GitTransitionId, resulting_tree: Option<GitTreeRef>, ) -> Result<GitCommandOutput, GitCompatError<S::Error>>

Commits a prepared transition after its filesystem action succeeds.

Source

pub async fn complete_transition_result( &self, transition: GitTransitionId, result: &GitFilesystemResult, ) -> Result<GitCommandOutput, GitCompatError<S::Error>>

Commits a prepared transition using the executor’s complete typed result.

Capture and branch transitions require their full result so recovery can publish compatibility state without reconstructing filesystem facts.

Source

pub async fn abort_transition( &self, transition: GitTransitionId, ) -> Result<(), GitCompatError<S::Error>>

Clears an exact prepared transition after the executor proves that no filesystem effects remain (or after the materializer rolls them back).

Source

pub async fn execute_argv<T: IntoGitTreeRef>( &self, argv: &[String], workspace_tree: T, default_author: &str, now_seconds: i64, ) -> Result<GitCommandOutput, GitCompatError<S::Error>>

Parses and executes argv following the acyclic git umbrella subcommand. Callers strip the two-token prefix before invoking this method; bare system git is outside this façade.

Source

pub async fn register_branch_workspace( &self, branch: impl Into<String>, workspace_id: WorkspaceId, head: Option<GitCommitId>, switch: bool, ) -> Result<GitCommandOutput, GitCompatError<S::Error>>

Completes a previously emitted GitFilesystemAction::ForkBranch.

The caller must create a real SDK child workspace first. Registration is idempotent for the same branch/workspace/head tuple and rejects any competing result.

Source

pub async fn record_commit( &self, expected_head: Option<GitCommitId>, generation: GenerationId, tracked_paths: BTreeSet<String>, message: impl Into<String>, author: impl Into<String>, authored_at_seconds: i64, ) -> Result<GitCommandOutput, GitCompatError<S::Error>>

Records a compatibility commit after the core executor filters newly ignored paths and returns the exact eligible generation.

Source

pub async fn record_publication( &self, publication: GitPublicationRecord, ) -> Result<GitCommandOutput, GitCompatError<S::Error>>

Records a merge/publication performed by the distributed workspace layer without reimplementing compatibility history in an adapter.

Auto Trait Implementations§

§

impl<S> Freeze for GitCompatRepository<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for GitCompatRepository<S>
where S: RefUnwindSafe,

§

impl<S> Send for GitCompatRepository<S>
where S: Send,

§

impl<S> Sync for GitCompatRepository<S>
where S: Sync,

§

impl<S> Unpin for GitCompatRepository<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for GitCompatRepository<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for GitCompatRepository<S>
where S: 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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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> StorageFuture for T
where T: Send,

Source§

impl<T> StorageProvider for T
where T: Send + Sync + ?Sized,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more