pub struct ExecResult {
pub stdout: String,
pub stderr: String,
pub exit_code: i32,
pub control_flow: ControlFlow,
pub stdout_truncated: bool,
pub stderr_truncated: bool,
pub final_env: Option<HashMap<String, String>>,
pub events: Vec<TraceEvent>,
pub side_effects: Vec<BuiltinSideEffect>,
pub errexit_suppressed: bool,
}Expand description
Result of executing a bash script.
Fields§
§stdout: StringStandard output
stderr: StringStandard error
exit_code: i32Exit code
control_flow: ControlFlowControl flow signal (break, continue, return)
stdout_truncated: boolWhether stdout was truncated due to output size limits
stderr_truncated: boolWhether stderr was truncated due to output size limits
final_env: Option<HashMap<String, String>>Final environment state after execution (opt-in via capture_final_env)
events: Vec<TraceEvent>Structured trace events (empty when TraceMode::Off).
side_effects: Vec<BuiltinSideEffect>Structured side effects from builtin execution. The interpreter processes these after the builtin returns.
errexit_suppressed: boolWhen true, the non-zero exit code came from an AND-OR list (e.g. false && true)
and should NOT trigger set -e / errexit at the caller level.
Propagated through compound commands so nested loops don’t re-trigger errexit.
Implementations§
Source§impl ExecResult
impl ExecResult
Sourcepub fn err(stderr: impl Into<String>, exit_code: i32) -> Self
pub fn err(stderr: impl Into<String>, exit_code: i32) -> Self
Create a failed result with the given stderr.
Sourcepub fn with_code(stdout: impl Into<String>, exit_code: i32) -> Self
pub fn with_code(stdout: impl Into<String>, exit_code: i32) -> Self
Create a result with stdout and custom exit code.
Sourcepub fn with_control_flow(control_flow: ControlFlow) -> Self
pub fn with_control_flow(control_flow: ControlFlow) -> Self
Create a result with a control flow signal
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the result indicates success.
Trait Implementations§
Source§impl Clone for ExecResult
impl Clone for ExecResult
Source§fn clone(&self) -> ExecResult
fn clone(&self) -> ExecResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more