pub struct CleanupService;Expand description
Service for coordinating PR cleanup operations.
Orchestrates safety checks, git operations, and worktree handling.
Implementations§
Source§impl CleanupService
impl CleanupService
Sourcepub async fn cleanup_single_pr(
provider: &dyn PrProvider,
pr_number: u64,
args: &CleanupArgs,
) -> Result<CleanupResult>
pub async fn cleanup_single_pr( provider: &dyn PrProvider, pr_number: u64, args: &CleanupArgs, ) -> Result<CleanupResult>
Clean up a single PR’s branches and optionally its worktree.
§Errors
Returns an error if:
- Safety checks fail
- Git operations fail
- Worktree operations fail
Sourcepub async fn cleanup(
provider: &dyn PrProvider,
args: &CleanupArgs,
) -> Result<Vec<CleanupResult>>
pub async fn cleanup( provider: &dyn PrProvider, args: &CleanupArgs, ) -> Result<Vec<CleanupResult>>
Clean up multiple PRs by number.
Continues on individual failures and collects all results.
§Errors
Returns an error only if the provider call itself fails. Individual PR cleanup failures are captured in the results.
Sourcepub async fn plan_merged(provider: &dyn PrProvider) -> Result<CleanupPlan>
pub async fn plan_merged(provider: &dyn PrProvider) -> Result<CleanupPlan>
Work out which merged PRs --merged would clean up, without deleting
anything.
§Errors
Returns an error if listing PRs fails.
Sourcepub async fn plan_closed(provider: &dyn PrProvider) -> Result<CleanupPlan>
pub async fn plan_closed(provider: &dyn PrProvider) -> Result<CleanupPlan>
Work out which closed PRs --closed would clean up, without deleting
anything.
§Errors
Returns an error if listing PRs fails.
Sourcepub async fn execute_plan(
provider: &dyn PrProvider,
args: &CleanupArgs,
plan: &CleanupPlan,
) -> Result<Vec<CleanupResult>>
pub async fn execute_plan( provider: &dyn PrProvider, args: &CleanupArgs, plan: &CleanupPlan, ) -> Result<Vec<CleanupResult>>
Execute an already-computed CleanupPlan.
§Errors
Individual PR failures are captured in the results rather than aborting the batch; this only returns an error if it cannot continue.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CleanupService
impl RefUnwindSafe for CleanupService
impl Send for CleanupService
impl Sync for CleanupService
impl Unpin for CleanupService
impl UnsafeUnpin for CleanupService
impl UnwindSafe for CleanupService
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
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> ⓘ
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> ⓘ
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