pub trait GhClient {
// Required methods
fn list_open_prs(&self, dir: &Path) -> Result<Vec<PrSummary>>;
fn view_pr(&self, dir: &Path, target: &str) -> Result<PrView>;
fn default_branch(&self, dir: &Path) -> Result<Option<String>>;
fn find_pr_for_branch(
&self,
dir: &Path,
branch: &str,
) -> Result<Option<OpenPr>>;
fn create_pr(&self, dir: &Path, args: &[String]) -> Result<String>;
fn edit_pr(&self, dir: &Path, args: &[String]) -> Result<String>;
// Provided method
fn open_pr_numbers(&self, dir: &Path) -> Result<Vec<u64>> { ... }
}Expand description
Performs GitHub pull-request operations via gh.
Required Methods§
Sourcefn list_open_prs(&self, dir: &Path) -> Result<Vec<PrSummary>>
fn list_open_prs(&self, dir: &Path) -> Result<Vec<PrSummary>>
Lists open PRs for the repository at dir.
Sourcefn view_pr(&self, dir: &Path, target: &str) -> Result<PrView>
fn view_pr(&self, dir: &Path, target: &str) -> Result<PrView>
Views the PR identified by target (a number, URL, or head branch).
Sourcefn default_branch(&self, dir: &Path) -> Result<Option<String>>
fn default_branch(&self, dir: &Path) -> Result<Option<String>>
The repository’s default branch (gh repo view --json defaultBranchRef),
or None on any failure (kept non-fatal so trunk detection can fall back
to local git state offline).
Sourcefn find_pr_for_branch(&self, dir: &Path, branch: &str) -> Result<Option<OpenPr>>
fn find_pr_for_branch(&self, dir: &Path, branch: &str) -> Result<Option<OpenPr>>
The open PR whose head is branch, if any.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".