Skip to main content

TaskKind

Enum TaskKind 

Source
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

Source

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.

Source

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).

Source

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§

Source§

impl Clone for TaskKind

Source§

fn clone(&self) -> TaskKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TaskKind

Source§

impl Debug for TaskKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TaskKind

Source§

impl Hash for TaskKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TaskKind

Source§

fn eq(&self, other: &TaskKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TaskKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.