Skip to main content

BackgroundResult

Enum BackgroundResult 

Source
pub enum BackgroundResult {
    RepoLoaded {
        path: PathBuf,
        result: Result<RepoPayload, String>,
    },
    FetchDone(Result<(), String>),
    CommitDiffLoaded(Result<Vec<DiffInfo>, String>),
    StagingRefreshed(Result<StagingPayload, String>),
    OperationDone {
        ok_message: Option<String>,
        err_message: Option<String>,
        needs_refresh: bool,
        needs_staging_refresh: bool,
    },
    CommitFileListLoaded(Result<Vec<DiffFileEntry>, String>),
    SingleFileDiffLoaded(Result<(usize, DiffInfo), String>),
    SearchResults(Result<Vec<CommitInfo>, String>),
    CommitRangeDiffLoaded(Result<Vec<DiffInfo>, String>),
    FileHistoryLoaded {
        path: String,
        commits: Vec<CommitInfo>,
    },
    FileBlameLoaded {
        path: String,
        lines: Vec<BlameLine>,
    },
    GitStateChanged,
}
Expand description

Results produced by background tasks and sent back to the main loop.

Variants§

§

RepoLoaded

A repo open / refresh completed. The PathBuf identifies which tab initiated the load so the result is applied to the correct tab.

Fields

§path: PathBuf
§

FetchDone(Result<(), String>)

A fetch completed.

§

CommitDiffLoaded(Result<Vec<DiffInfo>, String>)

A commit-diff load completed.

§

StagingRefreshed(Result<StagingPayload, String>)

A staging-only refresh completed (unstaged + staged diffs reloaded).

§

OperationDone

A single-shot operation (stage, unstage, checkout, commit, stash, etc.) completed and the staging area should be refreshed.

Fields

§ok_message: Option<String>
§err_message: Option<String>
§needs_refresh: bool

If true, trigger a full refresh after applying the result.

§needs_staging_refresh: bool

If true, trigger only a staging refresh.

§

CommitFileListLoaded(Result<Vec<DiffFileEntry>, String>)

A commit file list (lightweight, no diff content) was loaded.

§

SingleFileDiffLoaded(Result<(usize, DiffInfo), String>)

A single file’s diff was loaded. The usize is the file index in commit_files.

§

SearchResults(Result<Vec<CommitInfo>, String>)

Commit search results loaded.

§

CommitRangeDiffLoaded(Result<Vec<DiffInfo>, String>)

Combined range diff across multiple selected commits.

§

FileHistoryLoaded

File history (commits touching a specific file) loaded.

Fields

§path: String
§commits: Vec<CommitInfo>
§

FileBlameLoaded

File blame lines loaded.

Fields

§path: String
§

GitStateChanged

The .git directory changed from outside the TUI — trigger a full refresh.

Trait Implementations§

Source§

impl Debug for BackgroundResult

Source§

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

Formats the value using the given formatter. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more