pub trait PlatformService: Send + Sync {
// Required methods
fn find_existing_pr<'life0, 'life1, 'async_trait>(
&'life0 self,
head_branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PullRequest>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_pr_with_options<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
base: &'life2 str,
title: &'life3 str,
draft: bool,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn update_pr_base<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
new_base: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn publish_pr<'life0, 'async_trait>(
&'life0 self,
pr_number: u64,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_pr_comments<'life0, 'async_trait>(
&'life0 self,
pr_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<PrComment>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_pr_comment<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
body: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_pr_comment<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
comment_id: u64,
body: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn config(&self) -> &PlatformConfig;
// Provided method
fn create_pr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
base: &'life2 str,
title: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}Expand description
Platform service trait for PR/MR operations
This trait abstracts GitHub and GitLab operations, allowing the same submission logic to work with either platform.
Required Methods§
Sourcefn find_existing_pr<'life0, 'life1, 'async_trait>(
&'life0 self,
head_branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PullRequest>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_existing_pr<'life0, 'life1, 'async_trait>(
&'life0 self,
head_branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PullRequest>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find an existing open PR for a head branch
Sourcefn create_pr_with_options<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
base: &'life2 str,
title: &'life3 str,
draft: bool,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_pr_with_options<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
base: &'life2 str,
title: &'life3 str,
draft: bool,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create a new PR with explicit draft option.
Implementors must provide this method. The default create_pr method
delegates here with draft: false.
Sourcefn update_pr_base<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
new_base: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_pr_base<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
new_base: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update the base branch of an existing PR
Sourcefn publish_pr<'life0, 'async_trait>(
&'life0 self,
pr_number: u64,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish_pr<'life0, 'async_trait>(
&'life0 self,
pr_number: u64,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publish a draft PR (convert to ready for review)
Sourcefn list_pr_comments<'life0, 'async_trait>(
&'life0 self,
pr_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<PrComment>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_pr_comments<'life0, 'async_trait>(
&'life0 self,
pr_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<PrComment>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List comments on a PR
Sourcefn create_pr_comment<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
body: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_pr_comment<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
body: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a comment on a PR
Sourcefn update_pr_comment<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
comment_id: u64,
body: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_pr_comment<'life0, 'life1, 'async_trait>(
&'life0 self,
pr_number: u64,
comment_id: u64,
body: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing comment on a PR
Sourcefn config(&self) -> &PlatformConfig
fn config(&self) -> &PlatformConfig
Get the platform configuration
Provided Methods§
Sourcefn create_pr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
base: &'life2 str,
title: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_pr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
base: &'life2 str,
title: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create a new PR with default options (non-draft).
This is a convenience method that delegates to create_pr_with_options
with draft: false. Implementors should override create_pr_with_options,
not this method.