pub trait VcsRepo: Send + Sync {
Show 30 methods
// Required methods
fn kind(&self) -> BackendKind;
fn root(&self) -> &Path;
fn cwd(&self) -> &Path;
fn cleanup_worktree_blocking(&self, path: &Path) -> Result<()>;
fn current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn trunk<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn local_branches<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn branch_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn has_uncommitted_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn has_tracked_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn conflicted_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn rename_branch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
old: &'life1 str,
new: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn changed_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileChange>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn diff_stat<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DiffStat>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RepoSnapshot>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit_paths<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
paths: &'life1 [String],
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn fetch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_from<'life0, 'life1, 'async_trait>(
&'life0 self,
remote: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_remote_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn push<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn rebase<'life0, 'life1, 'async_trait>(
&'life0 self,
onto: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn try_merge<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MergeProbe>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn abort_in_progress<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn continue_in_progress<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn in_progress_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_worktrees<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorktreeInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_worktree<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
branch: &'life2 str,
base: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CreateOutcome>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn remove_worktree<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
The backend-agnostic common surface of Repo, as a trait — so a consumer can
hold a Box<dyn VcsRepo> / &dyn VcsRepo and code against the operations
without naming the ProcessRunner generic or wrapping Repo themselves.
Every method mirrors the like-named inherent method on Repo; the trait adds
nothing but the abstraction boundary. Tool-specific operations stay off it (see
the crate docs) — reach those through the concrete Repo and its bound
handles. For hermetic tests, build a Repo over a fake runner with
Repo::from_git / Repo::from_jj rather than mocking this trait.
Required Methods§
Sourcefn kind(&self) -> BackendKind
fn kind(&self) -> BackendKind
Which backend drives this handle.
Sourcefn cleanup_worktree_blocking(&self, path: &Path) -> Result<()>
fn cleanup_worktree_blocking(&self, path: &Path) -> Result<()>
Sourcefn current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::current_branch.
Sourcefn trunk<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn trunk<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::trunk.
Sourcefn local_branches<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn local_branches<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::local_branches.
Sourcefn branch_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn branch_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
See Repo::branch_exists.
Sourcefn has_uncommitted_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has_uncommitted_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn has_tracked_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has_tracked_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn conflicted_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn conflicted_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn delete_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
See Repo::delete_branch.
Sourcefn rename_branch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
old: &'life1 str,
new: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename_branch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
old: &'life1 str,
new: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
See Repo::rename_branch.
Sourcefn changed_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileChange>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn changed_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileChange>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::changed_files.
Sourcefn diff_stat<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DiffStat>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn diff_stat<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DiffStat>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::diff_stat.
Sourcefn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RepoSnapshot>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RepoSnapshot>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::snapshot.
Sourcefn commit_paths<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
paths: &'life1 [String],
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn commit_paths<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
paths: &'life1 [String],
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
See Repo::commit_paths.
Sourcefn fetch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::fetch.
Sourcefn fetch_from<'life0, 'life1, 'async_trait>(
&'life0 self,
remote: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_from<'life0, 'life1, 'async_trait>(
&'life0 self,
remote: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
See Repo::fetch_from.
Sourcefn fetch_remote_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_remote_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn push<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn push<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
See Repo::push.
Sourcefn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
reference: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
See Repo::checkout.
Sourcefn rebase<'life0, 'life1, 'async_trait>(
&'life0 self,
onto: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn rebase<'life0, 'life1, 'async_trait>(
&'life0 self,
onto: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
See Repo::rebase.
Sourcefn try_merge<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MergeProbe>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn try_merge<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MergeProbe>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
See Repo::try_merge.
Sourcefn abort_in_progress<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn abort_in_progress<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn continue_in_progress<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn continue_in_progress<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn in_progress_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn in_progress_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn list_worktrees<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorktreeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_worktrees<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorktreeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
See Repo::list_worktrees.
Sourcefn create_worktree<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
branch: &'life2 str,
base: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CreateOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_worktree<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
branch: &'life2 str,
base: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CreateOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".