aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_daemon/components
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 14:20:49 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 14:20:49 +0200
commit199563550dd41c3dfb703bd3747604a8a03cdbc5 (patch)
tree30cfa3e5539f782b7571091c742ee1c219e138fb /crates/turtle/src/atuin_daemon/components
parentchore: Restore db migrations (diff)
downloadatuin-199563550dd41c3dfb703bd3747604a8a03cdbc5.zip
chore: Remove all `pub`s
They will not be marked by rustc/cargo as unused, and as atuin doesn't expose an API all of them _should_ be `pub(crate)`
Diffstat (limited to 'crates/turtle/src/atuin_daemon/components')
-rw-r--r--crates/turtle/src/atuin_daemon/components/history.rs8
-rw-r--r--crates/turtle/src/atuin_daemon/components/mod.rs16
-rw-r--r--crates/turtle/src/atuin_daemon/components/search.rs12
-rw-r--r--crates/turtle/src/atuin_daemon/components/semantic.rs8
-rw-r--r--crates/turtle/src/atuin_daemon/components/sync.rs4
5 files changed, 24 insertions, 24 deletions
diff --git a/crates/turtle/src/atuin_daemon/components/history.rs b/crates/turtle/src/atuin_daemon/components/history.rs
index 95d34b69..ec41977f 100644
--- a/crates/turtle/src/atuin_daemon/components/history.rs
+++ b/crates/turtle/src/atuin_daemon/components/history.rs
@@ -36,7 +36,7 @@ const DAEMON_PROTOCOL_VERSION: u32 = 1;
/// - Saves completed commands to the database and record store
/// - Emits history events for other components (e.g., search indexing)
/// - Provides the History gRPC service
-pub struct HistoryComponent {
+pub(crate) struct HistoryComponent {
inner: Arc<HistoryComponentInner>,
}
@@ -53,7 +53,7 @@ struct HistoryComponentInner {
impl HistoryComponent {
/// Create a new history component.
- pub fn new() -> Self {
+ pub(crate) fn new() -> Self {
Self {
inner: Arc::new(HistoryComponentInner {
running: DashMap::new(),
@@ -66,7 +66,7 @@ impl HistoryComponent {
/// Get the gRPC service for this component.
///
/// This returns a tonic service that can be added to a gRPC server.
- pub fn grpc_service(&self) -> HistoryServer<HistoryGrpcService> {
+ pub(crate) fn grpc_service(&self) -> HistoryServer<HistoryGrpcService> {
HistoryServer::new(HistoryGrpcService {
inner: self.inner.clone(),
})
@@ -112,7 +112,7 @@ impl Component for HistoryComponent {
/// The gRPC service implementation.
///
/// This is a thin wrapper that delegates to the component's shared state.
-pub struct HistoryGrpcService {
+pub(crate) struct HistoryGrpcService {
inner: Arc<HistoryComponentInner>,
}
diff --git a/crates/turtle/src/atuin_daemon/components/mod.rs b/crates/turtle/src/atuin_daemon/components/mod.rs
index 447e31df..5a93fbc1 100644
--- a/crates/turtle/src/atuin_daemon/components/mod.rs
+++ b/crates/turtle/src/atuin_daemon/components/mod.rs
@@ -14,12 +14,12 @@
//! - [`semantic::SemanticComponent`]: In-memory semantic command captures
//! - [`sync::SyncComponent`]: Cloud sync
-pub mod history;
-pub mod search;
-pub mod semantic;
-pub mod sync;
+pub(crate) mod history;
+pub(crate) mod search;
+pub(crate) mod semantic;
+pub(crate) mod sync;
-pub use history::HistoryComponent;
-pub use search::SearchComponent;
-pub use semantic::SemanticComponent;
-pub use sync::SyncComponent;
+pub(crate) use history::HistoryComponent;
+pub(crate) use search::SearchComponent;
+pub(crate) use semantic::SemanticComponent;
+pub(crate) use sync::SyncComponent;
diff --git a/crates/turtle/src/atuin_daemon/components/search.rs b/crates/turtle/src/atuin_daemon/components/search.rs
index 85191cff..17decdad 100644
--- a/crates/turtle/src/atuin_daemon/components/search.rs
+++ b/crates/turtle/src/atuin_daemon/components/search.rs
@@ -34,7 +34,7 @@ const FRECENCY_REFRESH_INTERVAL_SECS: u64 = 60;
/// - Loads history from the database on startup
/// - Updates the index when history events occur
/// - Provides the Search gRPC service
-pub struct SearchComponent {
+pub(crate) struct SearchComponent {
index: Arc<RwLock<SearchIndex>>,
handle: tokio::sync::RwLock<Option<DaemonHandle>>,
loader_handle: Option<tokio::task::JoinHandle<()>>,
@@ -43,7 +43,7 @@ pub struct SearchComponent {
impl SearchComponent {
/// Create a new search component.
- pub fn new() -> Self {
+ pub(crate) fn new() -> Self {
Self {
index: Arc::new(RwLock::new(SearchIndex::new())),
handle: tokio::sync::RwLock::new(None),
@@ -53,7 +53,7 @@ impl SearchComponent {
}
/// Get the gRPC service for this component.
- pub fn grpc_service(&self) -> SearchServer<SearchGrpcService> {
+ pub(crate) fn grpc_service(&self) -> SearchServer<SearchGrpcService> {
SearchServer::new(SearchGrpcService {
index: self.index.clone(),
})
@@ -273,7 +273,7 @@ impl Component for SearchComponent {
}
/// The gRPC service implementation.
-pub struct SearchGrpcService {
+pub(crate) struct SearchGrpcService {
index: Arc<RwLock<SearchIndex>>,
}
@@ -395,7 +395,7 @@ fn convert_filter_mode(
}
#[cfg(windows)]
-pub fn with_trailing_slash(s: &str) -> String {
+pub(crate) fn with_trailing_slash(s: &str) -> String {
if s.ends_with('\\') {
s.to_string()
} else {
@@ -404,7 +404,7 @@ pub fn with_trailing_slash(s: &str) -> String {
}
#[cfg(not(windows))]
-pub fn with_trailing_slash(s: &str) -> String {
+pub(crate) fn with_trailing_slash(s: &str) -> String {
if s.ends_with('/') {
s.to_string()
} else {
diff --git a/crates/turtle/src/atuin_daemon/components/semantic.rs b/crates/turtle/src/atuin_daemon/components/semantic.rs
index a42fd5cb..052c2d73 100644
--- a/crates/turtle/src/atuin_daemon/components/semantic.rs
+++ b/crates/turtle/src/atuin_daemon/components/semantic.rs
@@ -29,7 +29,7 @@ const MAX_BYTES_PER_SESSION: usize = 32 * 1024 * 1024;
const MAX_PENDING_HISTORIES: usize = 128;
/// Stores completed command captures and associates them with history events.
-pub struct SemanticComponent {
+pub(crate) struct SemanticComponent {
inner: Arc<SemanticComponentInner>,
}
@@ -83,7 +83,7 @@ struct SemanticCommandRecord {
}
impl SemanticComponent {
- pub fn new() -> Self {
+ pub(crate) fn new() -> Self {
Self {
inner: Arc::new(SemanticComponentInner {
state: Mutex::new(SemanticState::default()),
@@ -91,7 +91,7 @@ impl SemanticComponent {
}
}
- pub fn grpc_service(&self) -> SemanticServer<SemanticGrpcService> {
+ pub(crate) fn grpc_service(&self) -> SemanticServer<SemanticGrpcService> {
SemanticServer::new(SemanticGrpcService {
inner: self.inner.clone(),
})
@@ -452,7 +452,7 @@ impl Display for SessionId {
}
}
-pub struct SemanticGrpcService {
+pub(crate) struct SemanticGrpcService {
inner: Arc<SemanticComponentInner>,
}
diff --git a/crates/turtle/src/atuin_daemon/components/sync.rs b/crates/turtle/src/atuin_daemon/components/sync.rs
index c76fb71b..93d1024a 100644
--- a/crates/turtle/src/atuin_daemon/components/sync.rs
+++ b/crates/turtle/src/atuin_daemon/components/sync.rs
@@ -41,14 +41,14 @@ enum SyncState {
/// - Implements exponential backoff on sync failures
/// - Responds to ForceSync events for immediate sync
/// - Emits SyncCompleted/SyncFailed events
-pub struct SyncComponent {
+pub(crate) struct SyncComponent {
task_handle: Option<tokio::task::JoinHandle<()>>,
command_tx: Option<mpsc::Sender<SyncCommand>>,
}
impl SyncComponent {
/// Create a new sync component.
- pub fn new() -> Self {
+ pub(crate) fn new() -> Self {
Self {
task_handle: None,
command_tx: None,