Skip to main content

PullRequestSource

Trait PullRequestSource 

Source
pub trait PullRequestSource: Send + Sync {
Show 26 methods // Required methods fn list<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 PullRequestQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<PullRequest>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn threads<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<CommentThread>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn changes<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileChange>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn add_comment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, item: &'life1 ItemRef, body: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn vote<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, vote: ReviewVote, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn merge<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, item: &'life1 ItemRef, options: &'life2 MergeOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; // Provided methods fn current_user<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn timeline<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<TimelineEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn checks<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<CheckRun>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn commits<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<Commit>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn list_omits_decoration(&self) -> bool { ... } fn list_targets_filter(&self) -> bool { ... } fn review_clears_request(&self) -> bool { ... } fn decorate<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<PrDecoration>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn commit_changes<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _sha: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileChange>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn file_text<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _path: &'life2 str, _sha: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn reply_to_thread<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, item: &'life1 ItemRef, _thread_id: &'life2 str, body: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn revert<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn submit_review<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _event: ReviewVote, _comments: &'life2 [LineComment], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn pr_writes(&self) -> PrWriteSupport { ... } fn resolve_thread<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _thread_id: &'life2 str, _resolved: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn set_draft<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _draft: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn set_closed<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _closed: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn reviewable_users<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<User>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn request_reviewer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _user_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... }
}
Expand description

Pull requests from one connection. Every method that names a single pull request takes an ItemRef, not a bare id: on a connection spanning several repositories the id alone does not say which #7 is meant, and guessing silently opens, merges or comments on the wrong one. The repo on the ref is connection-relative.

Required Methods§

Source

fn list<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 PullRequestQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<PullRequest>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<PullRequest>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn threads<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<CommentThread>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn changes<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileChange>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn add_comment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, item: &'life1 ItemRef, body: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn vote<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, vote: ReviewVote, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn merge<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, item: &'life1 ItemRef, options: &'life2 MergeOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn current_user<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The handle identifying the signed-in user on this connection — the same identity list resolves internally when it is asked for Mine or ReviewRequested.

Exposed so a caller can fetch one unfiltered pool and derive those views itself, rather than issuing a list per filter that re-fetches identical rows. It is matched against a user’s handle, display name or id by apply_pull_request_filter.

None — the default, and what a provider returns when it cannot establish an identity — makes that filter pass everything through rather than silently emptying the list. A caller deriving views locally must treat it as “cannot filter”, not as “nothing matches”: showing an unfiltered list under a “Mine” heading is wrong, but quietly showing none of your pull requests is worse, and matches what list already does in the same situation.

Source

fn timeline<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<TimelineEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The event timeline (reviews/approvals, merges, state changes, …), oldest → newest. Defaults to empty for providers without a timeline/activity API.

Source

fn checks<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<CheckRun>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Individual named CI checks. Defaults to empty for providers that don’t expose them.

Source

fn commits<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<Commit>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Commits on the pull request. Defaults to empty.

Source

fn list_omits_decoration(&self) -> bool

Whether this provider’s list endpoint leaves the decorated fields out, so a caller that skipped decoration has to fetch them per row to show them.

false by default, and that is the right answer for most providers: GitLab, Azure DevOps and Bitbucket fill everything they have straight from the list payload, so asking them for decoration is a call per row that returns what the caller already had. GitHub is the exception — /pulls omits mergeable_state, changed_files, additions and deletions entirely — and overrides this.

Source

fn list_targets_filter(&self) -> bool

Whether list asks the provider for the rows of a Mine or ReviewRequested filter, rather than fetching a page per repository and filtering it.

false by default, for a provider that fetches the newest page of each repository in scope and keeps the rows that match: its filtered list returns a subset of what an unfiltered one would have, and a caller holding the unfiltered rows gains nothing by asking again. On a busy repository that page is a window — the newest 50 pull requests — and your own fall out of it as soon as 50 newer ones exist. A provider that addresses the filter itself overrides this (GitHub searches author:@me across the scope; GitLab, Azure DevOps and Bitbucket pass the author or reviewer to each repository’s list), so a caller that pools the unfiltered rows knows those views are worth fetching on their own.

Source

fn review_clears_request(&self) -> bool

Whether giving your review takes a pull request out of the ReviewRequested view.

false by default: on GitLab, Azure DevOps and Bitbucket you stay a reviewer after you have voted, so the merge request keeps naming you and keeps its place in the view. GitHub is the exception — requested_reviewers only names those who have not reviewed yet, and the view is built on it — so a pull request leaves the view the moment you review it. A caller that knows this can take the row off its list as soon as the review is sent, rather than on the refetch that would.

Source

fn decorate<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<PrDecoration>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The fields the list endpoint omits, for one pull request. Defaults to projecting them out of a full get — providers with a cheaper route override it.

Source

fn commit_changes<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _sha: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileChange>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Files changed by a single commit on the pull request (with inline patches where the provider supplies them). Defaults to unsupported (empty).

Source

fn file_text<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _path: &'life2 str, _sha: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

The full text of path as of commit sha — the pull request’s head when sha is None — so a diff can show the unchanged lines between its hunks. Fetched on demand, never on a reload. None when the forge can’t say: a binary or oversized file, a path missing at that commit, or (the default) a provider without a content API.

Source

fn reply_to_thread<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, item: &'life1 ItemRef, _thread_id: &'life2 str, body: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Replies to an existing comment thread (returned by threads), so you can answer someone else’s comment in-thread rather than starting a new top-level one. Defaults to posting a plain top-level comment — providers whose threads are really flat (e.g. a GitHub PR conversation, which has no reply API) keep that behaviour; providers with real threads (Azure, GitLab discussions, Bitbucket, GitHub review threads) override it.

Source

fn revert<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reverts a merged pull request (undoes its merge commit on the target branch). Defaults to unsupported — only providers with a revert API (GitLab, Azure DevOps) override this.

Source

fn submit_review<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _event: ReviewVote, _comments: &'life2 [LineComment], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Submits a review with inline line comments. event maps to approve / request-changes / plain comment. Defaults to unsupported.

Source

fn pr_writes(&self) -> PrWriteSupport

Which of the writes below this connection can perform. Nothing by default; a provider reports exactly the ones it implements so a frontend offers only those.

Source

fn resolve_thread<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _thread_id: &'life2 str, _resolved: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Marks a comment thread (by the id threads gave it) resolved or, with resolved = false, open again. Defaults to unsupported.

Source

fn set_draft<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _draft: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Converts an open pull request to a draft (draft = true) or marks a draft ready for review (draft = false). Defaults to unsupported.

Source

fn set_closed<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _closed: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Closes an open pull request without merging (closed = true) or reopens a closed one (closed = false). Defaults to unsupported.

Source

fn reviewable_users<'life0, 'life1, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The people who can be asked to review this pull request — the repository’s collaborators, members or team, depending on the forge. Fetched once per repository and kept for the run by a caller; a provider should likewise cache it on its client. Defaults to none.

Source

fn request_reviewer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _item: &'life1 ItemRef, _user_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Asks user_id (an id from reviewable_users) to review the pull request, keeping any reviewers already on it. Defaults to unsupported.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§