feat: ipc server and cli

This commit is contained in:
Jake Stanger
2023-06-22 23:06:45 +01:00
parent 93baf8f568
commit f5bdc5a027
10 changed files with 427 additions and 6 deletions

17
src/ipc/responses.rs Normal file
View File

@@ -0,0 +1,17 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum Response {
Ok,
Err { message: Option<String> },
}
impl Response {
/// Creates a new `Response::Error`.
pub fn error(message: &str) -> Self {
Self::Err {
message: Some(message.to_string()),
}
}
}