plexus_substrate/activations/bash/
types.rs1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3use thiserror::Error;
4
5#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
7#[serde(tag = "type", rename_all = "snake_case")]
8pub enum BashEvent {
9 Stdout { line: String },
11 Stderr { line: String },
13 Exit { code: i32 },
15 Error { message: String },
17}
18
19pub type BashOutput = BashEvent;
21
22#[derive(Debug, Error)]
24pub enum ExecutorError {
25 #[error("failed to spawn bash (command='{command}'): {source}")]
26 SpawnFailed {
27 command: String,
28 source: std::io::Error,
29 },
30
31 #[error("failed to capture {stream} from bash process (command='{command}')")]
32 StdioCaptureFailed {
33 stream: &'static str,
34 command: String,
35 },
36
37 #[error("failed to wait for bash process (command='{command}'): {source}")]
38 WaitFailed {
39 command: String,
40 source: std::io::Error,
41 },
42}