feat: ipc server and cli
This commit is contained in:
17
src/ipc/responses.rs
Normal file
17
src/ipc/responses.rs
Normal 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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user