pub trait ReviewProvider {
// Required methods
fn review_for_branch(&self, branch: &str) -> Result<Option<ReviewRequest>>;
fn review_for_branch_including_closed(
&self,
branch: &str,
) -> Result<Option<ReviewRequest>>;
fn create_review(
&self,
branch: &str,
base: &str,
draft: bool,
) -> Result<String>;
fn update_review_base(
&self,
review: &ReviewRequest,
base: &str,
) -> Result<String>;
fn review_body(&self, review: &ReviewRequest) -> Result<String>;
fn update_review_body(
&self,
review: &ReviewRequest,
body: &str,
) -> Result<String>;
fn merge_review(
&self,
review: &ReviewRequest,
strategy: &str,
auto: bool,
) -> Result<String>;
fn wait_for_checks(&self, review: &ReviewRequest) -> Result<bool>;
fn mark_ready(&self, review: &ReviewRequest) -> Result<String>;
}Required Methods§
fn review_for_branch(&self, branch: &str) -> Result<Option<ReviewRequest>>
Sourcefn review_for_branch_including_closed(
&self,
branch: &str,
) -> Result<Option<ReviewRequest>>
fn review_for_branch_including_closed( &self, branch: &str, ) -> Result<Option<ReviewRequest>>
Like review_for_branch, but also finds closed reviews. Kept separate so flows that act on a review (submit, sync, cleanup) never mistake a dead review for a live one; only the stack-notes ledger wants closed state, to restyle the entry rather than drop it.
Sourcefn create_review(&self, branch: &str, base: &str, draft: bool) -> Result<String>
fn create_review(&self, branch: &str, base: &str, draft: bool) -> Result<String>
Open a review for the branch; with draft, as a draft.
fn update_review_base( &self, review: &ReviewRequest, base: &str, ) -> Result<String>
fn review_body(&self, review: &ReviewRequest) -> Result<String>
fn update_review_body( &self, review: &ReviewRequest, body: &str, ) -> Result<String>
Sourcefn merge_review(
&self,
review: &ReviewRequest,
strategy: &str,
auto: bool,
) -> Result<String>
fn merge_review( &self, review: &ReviewRequest, strategy: &str, auto: bool, ) -> Result<String>
Merge the review with the given strategy: squash, rebase, or merge.
With auto, schedule the merge for when required checks pass
instead of merging now.
Sourcefn wait_for_checks(&self, review: &ReviewRequest) -> Result<bool>
fn wait_for_checks(&self, review: &ReviewRequest) -> Result<bool>
Block until the review’s checks settle. Ok(true) when they pass (or there are none), Ok(false) when something failed.
Sourcefn mark_ready(&self, review: &ReviewRequest) -> Result<String>
fn mark_ready(&self, review: &ReviewRequest) -> Result<String>
Mark a draft review as ready for review.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".