1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mod protocol;

pub use io_plugin_macros::*;
pub use protocol::{io_read, io_read_async, io_write, io_write_async};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use tokio::process::{ChildStdin, ChildStdout};

#[derive(Debug, Serialize, Deserialize, Error)]
pub enum IOPluginError {
    #[error("Pipe has been closed")]
    PipeClosed,
    #[error("{0}")]
    Other(String),
}

pub struct ChildStdio {
    pub stdin: ChildStdin,
    pub stdout: ChildStdout,
}

pub type Mutex<T> = tokio::sync::Mutex<T>;
pub type Child = tokio::process::Child;