aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_daemon/events.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-09 21:43:23 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-09 21:43:23 +0200
commit3223d93cb3c77ab02aa0a35f2a8314e447cee9a4 (patch)
tree3971a1f37f5fe3cadb747c5229a0d54e868e45e3 /crates/turtle/src/atuin_daemon/events.rs
parentfix(client/sync): Pass through precise error on `SyncError::WrongKey` (diff)
downloadatuin-3223d93cb3c77ab02aa0a35f2a8314e447cee9a4.zip
chore: Separate daemon, client, server, and lib into crates
Diffstat (limited to 'crates/turtle/src/atuin_daemon/events.rs')
-rw-r--r--crates/turtle/src/atuin_daemon/events.rs77
1 files changed, 0 insertions, 77 deletions
diff --git a/crates/turtle/src/atuin_daemon/events.rs b/crates/turtle/src/atuin_daemon/events.rs
deleted file mode 100644
index d379277d..00000000
--- a/crates/turtle/src/atuin_daemon/events.rs
+++ /dev/null
@@ -1,77 +0,0 @@
-//! Daemon events.
-//!
-//! Events are the primary communication mechanism within the daemon.
-//! Components emit events to notify others of state changes, and handle
-//! events to react to changes elsewhere in the system.
-//!
-//! External processes (like CLI commands) can also inject events via the
-//! Control gRPC service.
-
-use crate::atuin_client::history::{History, HistoryId};
-use crate::atuin_common::record::RecordId;
-
-/// Events that flow through the daemon's event bus.
-///
-/// Events are broadcast to all components. Each component decides which
-/// events it cares about in its `handle_event` implementation.
-#[derive(Debug, Clone)]
-pub(crate) enum DaemonEvent {
- // ---- History lifecycle ----
- /// A command has started running.
- HistoryStarted(History),
-
- /// A command has finished running.
- HistoryEnded(History),
-
- // ---- Sync ----
- /// Records were synced from the server.
- ///
- /// The search component uses this to update its index with new history.
- RecordsAdded(Vec<RecordId>),
-
- /// Sync completed successfully.
- SyncCompleted {
- /// Number of records uploaded.
- #[expect(unused)]
- uploaded: usize,
-
- /// Number of records downloaded.
- #[expect(unused)]
- downloaded: usize,
- },
-
- /// Sync failed.
- SyncFailed {
- /// Error message describing what went wrong.
- error: String,
- },
-
- /// Request an immediate sync (external trigger).
- ForceSync,
-
- // ---- External commands ----
- /// History was pruned - search index needs a full rebuild.
- ///
- /// Emitted when the user runs `atuin history prune` or similar.
- HistoryPruned,
-
- /// History was rebuilt - search index needs a full rebuild.
- ///
- /// Emitted when the user runs `atuin store rebuild history` or similar.
- HistoryRebuilt,
-
- /// Specific history items were deleted.
- ///
- /// The search component should remove these from its index.
- HistoryDeleted {
- /// IDs of the deleted history entries.
- ids: Vec<HistoryId>,
- },
-
- /// Settings have changed, components should reload if needed.
- SettingsReloaded,
-
- // ---- Lifecycle ----
- /// Request graceful shutdown of the daemon.
- ShutdownRequested,
-}