Skip to main content

ctl_task_proto/
control.rs

1//! Versioned daemon lifecycle requests, independent of the task protocol.
2use serde::{Deserialize, Serialize};
3use std::path::PathBuf;
4
5pub const PROTOCOL_VERSION: u16 = 2;
6
7#[derive(Debug, Serialize, Deserialize)]
8#[serde(tag = "type", rename_all = "snake_case")]
9pub enum ClientMessage {
10  RestartDaemon { protocol_version: u16 },
11  ComponentStatus { protocol_version: u16 },
12}
13
14#[derive(Debug, Serialize, Deserialize)]
15#[serde(tag = "type", rename_all = "snake_case")]
16pub enum ServerMessage {
17  ComponentStatus {
18    build: ctl_component_info::ComponentBuildInfo,
19    protocol_version: u16,
20  },
21  RestartAccepted {
22    data_directory: PathBuf,
23    ctmux_socket: PathBuf,
24  },
25  Error {
26    message: String,
27  },
28}