aboutsummaryrefslogtreecommitdiff
path: root/src/events.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/events.rs')
-rw-r--r--src/events.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/events.rs b/src/events.rs
index 95638991..a614ee0c 100644
--- a/src/events.rs
+++ b/src/events.rs
@@ -52,6 +52,27 @@ pub struct WorktreeRemoveResult {
pub result: Result<(), String>,
}
+#[derive(Debug)]
+pub struct WorktreeReadResult {
+ // Keep the slot until completion is consumed, including time queued on the app loop.
+ pub(crate) _permit: tokio::sync::OwnedSemaphorePermit,
+ pub(crate) client_local: bool,
+ pub(crate) request: crate::api::schema::Request,
+ pub(crate) source_workspace_id: Option<String>,
+ pub(crate) source_cwd: Option<std::path::PathBuf>,
+ pub(crate) result: Result<WorktreeReadData, (String, String)>,
+ pub(crate) respond_to: std::sync::mpsc::Sender<String>,
+}
+
+#[derive(Debug)]
+pub(crate) struct WorktreeReadData {
+ pub source_checkout_path: std::path::PathBuf,
+ pub source_repo_root: std::path::PathBuf,
+ pub repo_key: String,
+ pub repo_name: String,
+ pub entries: Vec<crate::worktree::ExistingWorktree>,
+}
+
/// An event from a background task to the main loop.
#[derive(Debug)]
pub enum AppEvent {
@@ -173,4 +194,6 @@ pub enum AppEvent {
WorktreeAddFinished(Box<WorktreeAddResult>),
/// Background `git worktree remove` completed.
WorktreeRemoveFinished(Box<WorktreeRemoveResult>),
+ /// Background worktree discovery completed for an API list/open request.
+ WorktreeReadFinished(Box<WorktreeReadResult>),
}