pub struct ExecResult {
pub stdout: String,
pub stderr: String,
pub exit_code: i32,
pub control_flow: ControlFlow,
}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)
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecResult
impl Debug for ExecResult
Source§impl Default for ExecResult
impl Default for ExecResult
Source§fn default() -> ExecResult
fn default() -> ExecResult
Returns the “default value” for a type. Read more
Source§impl From<ExecResult> for ToolResponse
impl From<ExecResult> for ToolResponse
Source§fn from(result: ExecResult) -> Self
fn from(result: ExecResult) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ExecResult
impl RefUnwindSafe for ExecResult
impl Send for ExecResult
impl Sync for ExecResult
impl Unpin for ExecResult
impl UnwindSafe for ExecResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more