pub trait ForgeClient: Send + Sync {
// Required methods
fn auth_status(&self) -> Result<(), ForgeError>;
fn list_prs_for_head(
&self,
dir: &Path,
head_branch: &str,
) -> Result<Vec<PrRecord>, ForgeError>;
fn create_pr(
&self,
dir: &Path,
head_branch: &str,
base_branch: &str,
title: &str,
body: &str,
draft: bool,
) -> Result<PrRecord, ForgeError>;
fn set_pr_body(
&self,
dir: &Path,
number: u64,
body: &str,
) -> Result<(), ForgeError>;
fn ci_for_sha(
&self,
dir: &Path,
number: u64,
head_sha: &str,
) -> Result<CiSummary, ForgeError>;
// Provided method
fn reopen_pr(&self, _dir: &Path, _number: u64) -> Result<(), ForgeError> { ... }
}Expand description
The forge operations PR delivery needs, behind one vendor-neutral seam.
Commit creation and the append-only push remain plain git. This trait owns only the review artifact: authentication, pull-request reconciliation, body refresh, and checks for one exact head. Keeping those operations together is what prevents a second forge from becoming a parallel, weaker delivery path.
Required Methods§
Sourcefn auth_status(&self) -> Result<(), ForgeError>
fn auth_status(&self) -> Result<(), ForgeError>
Fail with a message naming the forge credential or login remedy.
Sourcefn list_prs_for_head(
&self,
dir: &Path,
head_branch: &str,
) -> Result<Vec<PrRecord>, ForgeError>
fn list_prs_for_head( &self, dir: &Path, head_branch: &str, ) -> Result<Vec<PrRecord>, ForgeError>
Every pull request whose head is head_branch, in any state.
fn create_pr( &self, dir: &Path, head_branch: &str, base_branch: &str, title: &str, body: &str, draft: bool, ) -> Result<PrRecord, ForgeError>
Sourcefn set_pr_body(
&self,
dir: &Path,
number: u64,
body: &str,
) -> Result<(), ForgeError>
fn set_pr_body( &self, dir: &Path, number: u64, body: &str, ) -> Result<(), ForgeError>
Replace a pull request’s body wholesale.
Sourcefn ci_for_sha(
&self,
dir: &Path,
number: u64,
head_sha: &str,
) -> Result<CiSummary, ForgeError>
fn ci_for_sha( &self, dir: &Path, number: u64, head_sha: &str, ) -> Result<CiSummary, ForgeError>
Check runs, policies, and commit statuses for one exact PR head.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".