pub struct ProcessResult {
pub process_id: Option<u64>,
pub command: Vec<String>,
pub cwd: PathBuf,
pub status: ProcessStatus,
pub exit_code: Option<i32>,
pub stdout: Vec<String>,
pub stderr: Vec<String>,
pub elapsed: Duration,
pub kind: ProcessKind,
}Expand description
Structured result of a process execution.
Captures the command, working directory, exit status, stdout/stderr (capped and line-truncated), and elapsed time. This is the audit record persisted for session records; the full raw output is never stored beyond the byte cap.
Fields§
§process_id: Option<u64>Registry id for an owned background process, if applicable.
command: Vec<String>The argv that was run (program + args).
cwd: PathBufWorking directory the command ran in.
status: ProcessStatusFinal lifecycle status.
exit_code: Option<i32>Exit code if the process exited normally, else None.
stdout: Vec<String>Captured stdout, line-capped and byte-capped.
stderr: Vec<String>Captured stderr, line-capped and byte-capped.
elapsed: DurationWall-clock elapsed time.
kind: ProcessKindWhether this was a one-shot or background process.
Implementations§
Source§impl ProcessResult
impl ProcessResult
Sourcepub fn to_output_lines(&self) -> Vec<String>
pub fn to_output_lines(&self) -> Vec<String>
Lines for the tool ToolOutput: summary followed by stdout/stderr
markers and content. The summary line is also redacted in case the
command argv itself contains secret-like values.
Sourcepub fn to_failed_output(&self) -> ToolOutput
pub fn to_failed_output(&self) -> ToolOutput
Build a failed ToolOutput from this result.
Sourcepub fn to_tool_output(&self) -> ToolOutput
pub fn to_tool_output(&self) -> ToolOutput
Build the ToolOutput corresponding to this process result.
Trait Implementations§
Source§impl Clone for ProcessResult
impl Clone for ProcessResult
Source§fn clone(&self) -> ProcessResult
fn clone(&self) -> ProcessResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessResult
impl Debug for ProcessResult
impl Eq for ProcessResult
Source§impl PartialEq for ProcessResult
impl PartialEq for ProcessResult
impl StructuralPartialEq for ProcessResult
Auto Trait Implementations§
impl Freeze for ProcessResult
impl RefUnwindSafe for ProcessResult
impl Send for ProcessResult
impl Sync for ProcessResult
impl Unpin for ProcessResult
impl UnsafeUnpin for ProcessResult
impl UnwindSafe for ProcessResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more