mod error;
mod handle;
pub mod notification;
pub use error::*;
pub use handle::*;
pub use notification::*;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
#[serde(tag = "type", rename_all = "snake_case")]
#[schemars(rename = "cli.output.Output.{T}")]
pub enum Output<T> {
Error(Error),
Notification(Notification<T>),
Begin,
End,
}
impl<T: Serialize> Output<T> {
pub async fn emit(&self, handle: &Handle) {
handle.emit(self).await
}
}
#[cfg(test)]
mod tests;