pub enum ForgeClient {
GitHub(GitHubClient),
GitLab(GitLabClient),
Gitea(GiteaClient),
}Variants§
Implementations§
Source§impl ForgeClient
impl ForgeClient
pub fn new(remote: &RemoteInfo) -> Result<Self>
pub fn api_call_stats(&self) -> Option<ApiCallStats>
Sourcepub async fn find_open_pr_by_head(
&self,
branch: &str,
) -> Result<Option<PrInfoWithHead>>
pub async fn find_open_pr_by_head( &self, branch: &str, ) -> Result<Option<PrInfoWithHead>>
Find an open PR by head branch.
GitHub uses the stored owner for fork-aware lookup; other forges filter by source branch only.
pub async fn find_pr(&self, branch: &str) -> Result<Option<PrInfo>>
pub async fn list_open_prs_by_head( &self, ) -> Result<HashMap<String, PrInfoWithHead>>
pub async fn list_open_pull_requests( &self, limit: u8, ) -> Result<Vec<RepoPrListItem>>
pub async fn list_open_issues( &self, limit: u8, ) -> Result<Vec<RepoIssueListItem>>
pub async fn create_pr( &self, head: &str, base: &str, title: &str, body: &str, is_draft: bool, ) -> Result<PrInfo>
pub async fn get_pr(&self, number: u64) -> Result<PrInfo>
pub async fn get_pr_with_head(&self, number: u64) -> Result<PrInfoWithHead>
pub async fn update_pr_base(&self, number: u64, new_base: &str) -> Result<()>
Sourcepub async fn set_pr_draft(&self, number: u64, is_draft: bool) -> Result<()>
pub async fn set_pr_draft(&self, number: u64, is_draft: bool) -> Result<()>
Set the draft status of an existing PR.
is_draft = true converts to draft, is_draft = false marks ready for review.
Sourcepub async fn enqueue_pr(&self, number: u64) -> Result<EnqueueResult>
pub async fn enqueue_pr(&self, number: u64) -> Result<EnqueueResult>
Enqueue a PR into the forge’s merge queue (GitHub) or merge train (GitLab). Not supported on Gitea/Forgejo (no merge queue feature).
Sourcepub async fn update_pr_branch(&self, number: u64) -> Result<()>
pub async fn update_pr_branch(&self, number: u64) -> Result<()>
GitHub only: merge the PR base into the head branch remotely (“Update branch”).
pub async fn update_pr_title(&self, number: u64, title: &str) -> Result<()>
pub async fn update_pr_body(&self, number: u64, body: &str) -> Result<()>
pub async fn get_pr_body(&self, number: u64) -> Result<String>
pub async fn update_stack_comment( &self, number: u64, stack_comment: &str, ) -> Result<()>
pub async fn create_stack_comment( &self, number: u64, stack_comment: &str, ) -> Result<()>
pub async fn delete_stack_comment(&self, number: u64) -> Result<()>
pub async fn list_all_comments(&self, number: u64) -> Result<Vec<PrComment>>
pub async fn merge_pr( &self, number: u64, method: MergeMethod, commit_title: Option<&str>, sha: Option<&str>, ) -> Result<()>
pub async fn get_pr_merge_status(&self, number: u64) -> Result<PrMergeStatus>
pub async fn is_pr_merged(&self, number: u64) -> Result<bool>
pub async fn get_pr_head_sha(&self, number: u64) -> Result<String>
pub async fn fetch_checks( &self, repo: &GitRepo, sha: &str, ) -> Result<(Option<String>, Vec<CheckRunInfo>)>
pub async fn request_reviewers( &self, number: u64, reviewers: &[String], ) -> Result<()>
pub async fn get_requested_reviewers(&self, number: u64) -> Result<Vec<String>>
pub async fn add_labels(&self, number: u64, labels: &[String]) -> Result<()>
pub async fn add_assignees( &self, number: u64, assignees: &[String], ) -> Result<()>
pub async fn get_current_user(&self) -> Result<String>
pub async fn get_user_open_prs(&self, username: &str) -> Result<Vec<OpenPrInfo>>
pub async fn get_recent_merged_prs( &self, hours: i64, username: &str, ) -> Result<Vec<PrActivity>>
pub async fn get_recent_opened_prs( &self, hours: i64, username: &str, ) -> Result<Vec<PrActivity>>
pub async fn get_reviews_received( &self, hours: i64, username: &str, ) -> Result<Vec<ReviewActivity>>
pub async fn get_reviews_given( &self, hours: i64, username: &str, ) -> Result<Vec<ReviewActivity>>
Trait Implementations§
Source§impl Clone for ForgeClient
impl Clone for ForgeClient
Source§fn clone(&self) -> ForgeClient
fn clone(&self) -> ForgeClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for ForgeClient
impl !RefUnwindSafe for ForgeClient
impl Send for ForgeClient
impl Sync for ForgeClient
impl Unpin for ForgeClient
impl UnsafeUnpin for ForgeClient
impl !UnwindSafe for ForgeClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more