2022-04-15 23:33:56 +00:00
|
|
|
pub use ipc_channel::ipc;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
|
|
pub struct IpcHandshake {
|
|
|
|
pub requests: ipc::IpcSender<CliRequest>,
|
|
|
|
pub responses: ipc::IpcReceiver<CliResponse>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
pub enum CliRequest {
|
|
|
|
Open { paths: Vec<PathBuf>, wait: bool },
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
pub enum CliResponse {
|
2022-04-20 10:54:34 +00:00
|
|
|
Ping,
|
2022-04-15 23:33:56 +00:00
|
|
|
Stdout { message: String },
|
|
|
|
Stderr { message: String },
|
|
|
|
Exit { status: i32 },
|
|
|
|
}
|