aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/client/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crates/turtle/src/client/mod.rs (renamed from crates/daemon/src/api/client/mod.rs)33
1 files changed, 14 insertions, 19 deletions
diff --git a/crates/daemon/src/api/client/mod.rs b/crates/turtle/src/client/mod.rs
index c588fb09..07f01e6c 100644
--- a/crates/daemon/src/api/client/mod.rs
+++ b/crates/turtle/src/client/mod.rs
@@ -9,26 +9,21 @@ use hyper_util::rt::TokioIo;
#[cfg(unix)]
use tokio::net::UnixStream;
-use crate::api::generated;
-use crate::api::generated::control::{ForceSyncReply, ForceSyncRequest, PathsReply, PathsRequest};
-use crate::api::generated::history::{HistoryEntry, HistoryRequest};
-use crate::{
- aclient::history::History,
- api::{
- DAEMON_PROTOCOL_VERSION, DAEMON_VERSION,
- generated::{
- control::{
- StatusReply, StatusRequest, control_client::ControlClient as ControlServiceClient,
- },
- history::{
- EndHistoryReply, EndHistoryRequest, StartHistoryReply, StartHistoryRequest,
- TailHistoryRequest, history_client::HistoryClient as HistoryServiceClient,
- },
- },
+use crate::generated::{
+ self, DAEMON_PROTOCOL_VERSION,
+ control::{
+ ForceSyncReply, ForceSyncRequest, PathsReply, PathsRequest, StatusReply, StatusRequest,
+ control_client::ControlClient as ControlServiceClient,
+ },
+ history::{
+ EndHistoryReply, EndHistoryRequest, HistoryEntry, HistoryRequest, StartHistoryReply,
+ StartHistoryRequest, TailHistoryRequest,
+ history_client::HistoryClient as HistoryServiceClient,
},
};
-pub use crate::api::generated::history::{HistoryEventKind, TailHistoryReply};
+pub use crate::generated::history::{HistoryEventKind, TailHistoryReply};
+use crate::history::History;
fn normalize_optional_field(value: &str) -> Option<String> {
let trimmed = value.trim();
@@ -60,13 +55,13 @@ pub fn history_entry_to_history(entry: HistoryEntry) -> History {
#[must_use]
pub fn daemon_matches_expected(version: &str, protocol: u32) -> bool {
- version == DAEMON_VERSION && protocol == DAEMON_PROTOCOL_VERSION
+ protocol == DAEMON_PROTOCOL_VERSION
}
#[must_use]
pub fn daemon_mismatch_message(version: &str, protocol: u32) -> String {
if protocol == DAEMON_PROTOCOL_VERSION {
- format!("daemon is out of date: expected {DAEMON_VERSION}, got {version}")
+ unreachable!()
} else {
format!("daemon protocol mismatch: expected {DAEMON_PROTOCOL_VERSION}, got {protocol}")
}