pub trait SourceControl: Send + Sync {
Show 15 methods
// Required methods
fn name(&self) -> &str;
fn get_commits_since<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Commit>, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_last_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
pattern: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_tag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_current_commit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_working_tree_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WorkingTreeStatus, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
message: &'life1 str,
files: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn stage_files<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn push<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
remote: Option<&'life1 str>,
branch: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn repository_root(&self) -> Option<&Path>;
fn is_on_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_tags_for_commit<'life0, 'life1, 'async_trait>(
&'life0 self,
commit_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_remote_url<'life0, 'life1, 'async_trait>(
&'life0 self,
remote: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ScmError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for source control operations
Provides an abstraction over Git (and potentially other VCS) operations needed for release automation.
§Examples
The trait is used by implementors that provide Git (or other VCS) operations:
use governor_core::traits::source_control::SourceControl;
// A concrete implementation would provide:
let commits = scm.get_commits_since(Some("v1.0.0")).await?;
for commit in commits {
println!("{}: {}", commit.hash, commit.message);
}Required Methods§
Sourcefn get_commits_since<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Commit>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_commits_since<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Commit>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_last_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
pattern: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_last_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
pattern: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn create_tag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_tag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn delete_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_current_commit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_commit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_working_tree_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WorkingTreeStatus, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_working_tree_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WorkingTreeStatus, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if working tree is clean
§Returns
Status of the working tree including modified, added, deleted, and untracked files.
Sourcefn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
message: &'life1 str,
files: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
message: &'life1 str,
files: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn stage_files<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stage_files<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn push<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
remote: Option<&'life1 str>,
branch: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn push<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
remote: Option<&'life1 str>,
branch: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Push to remote
§Arguments
remote- Remote name (e.g., “origin”). IfNone, uses default.branch- Branch name to push. IfNone, pushes current branch.
Sourcefn repository_root(&self) -> Option<&Path>
fn repository_root(&self) -> Option<&Path>
Get repository root path
Sourcefn is_on_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_on_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if we’re on a specific branch