pub enum TaskKind {
CreateWorktree,
RefreshWorktrees,
GithubIssue(u64),
GithubPr(u64),
Sync,
Bootstrap,
DeleteWorktree,
Pull,
Push,
EditWorktree,
}Expand description
Identity of a background task — the coalescing key and the source of the loader label. One variant per migrated op.
Variants§
CreateWorktree
Off-thread create flow from the Create modal (issue #276):
worktree::add plus bootstrap can touch disk, refs, copies and hooks, so
the modal must stay renderable while it runs. A single global op like
Self::Bootstrap — one create in flight at a time.
RefreshWorktrees
Off-thread worktree list refresh (the f / r key path). The
synchronous App::refresh stays for internal post-mutation callers
(create / delete / report-close) that need the list fresh before the
next render.
GithubIssue(u64)
Off-thread gh issue view fetch for the linked issue, keyed by issue
number (issue #255 — migrated from the separate github_tx/inflight
channel). The number is the coalescing key, so Issue(42) and
Issue(43) are independent slots with independent generations — the
per-key identity the late-drop guard needs to discard a stale worker
without clobbering a newer one’s slot (the #138 guarantee, now keyed).
GithubPr(u64)
PR-side counterpart to Self::GithubIssue (gh pr view). Keyed by
PR number; never collides with an issue of the same number.
Sync
Off-thread gwm sync of the selected worktree (issue #258): fetch +
rebase/merge its branch onto upstream. A single global op like
Self::RefreshWorktrees — one sync in flight at a time, so a second
S press while one runs coalesces instead of racing a second rebase.
Bootstrap
Off-thread bootstrap of the selected worktree (issue #256 — the b
key): bootstrap::run (file copies, guards, command hooks) used to
block the event loop. A single global op like Self::Sync — one
bootstrap in flight at a time, so a second b press coalesces instead
of racing a second run. The TOFU trust gate stays on the main thread
before the spawn; completion sets App::report and flips to
View::Report.
DeleteWorktree
Off-thread delete of the selected worktree (issue #257):
worktree::remove can touch git admin files, remove the worktree
directory, and optionally delete the branch, so it must not block the
render loop while the confirm modal is open.
Pull
Off-thread git pull of the selected worktree’s branch (#290). One
global slot — a second p press coalesces while one is in flight.
Push
Off-thread git push of the selected worktree’s branch to its remote
(#290). One global slot — a second P press coalesces.
EditWorktree
Off-thread rename of the selected worktree (c, #290): renames the
local branch (git branch -m), the remote branch when it exists
(git push origin :<old> <new>:<new> + re-track), and moves the
worktree directory on disk (git worktree move) so the slug stays in
sync. One global slot — a second c submit coalesces.
Implementations§
Source§impl TaskKind
impl TaskKind
Sourcepub fn loading_label(self) -> &'static str
pub fn loading_label(self) -> &'static str
Human label the loader shows while this task is in flight, mirroring the GitHub fetch’s “fetching GitHub status…” so every async site reads consistently.
Sourcepub fn is_github(self) -> bool
pub fn is_github(self) -> bool
true for the GitHub fetch kinds (GithubIssue / GithubPr). Used
as the predicate for TaskRunner::invalidate_matching so the App
can drop every in-flight GitHub fetch on navigation / explicit refresh
without naming the (now-stale) issue/PR numbers it no longer holds
(issue #255).
Sourcepub fn is_mutating(self) -> bool
pub fn is_mutating(self) -> bool
true for workers that can leave repository / worktree state
partially changed if the process exits before their result is drained.
Trait Implementations§
impl Copy for TaskKind
impl Eq for TaskKind
impl StructuralPartialEq for TaskKind
Auto Trait Implementations§
impl Freeze for TaskKind
impl RefUnwindSafe for TaskKind
impl Send for TaskKind
impl Sync for TaskKind
impl Unpin for TaskKind
impl UnsafeUnpin for TaskKind
impl UnwindSafe for TaskKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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