Skip to main content

tokio_process_tools/
output.rs

1use std::process::ExitStatus;
2
3/// Full output of a process that terminated.
4///
5/// Both it's `stdout` and `stderr` streams were collected as individual lines. Depending on the
6/// [`crate::LineParsingOptions`] used, content might have been lost.
7#[derive(Debug, Clone, PartialEq, Eq)]
8pub struct Output {
9    /// Status the process exited with.
10    pub status: ExitStatus,
11
12    /// The processes entire output on its `stdout` stream, collected into individual lines.
13    ///
14    /// Depending on the [`crate::LineParsingOptions`] used, content might have been lost.
15    pub stdout: Vec<String>,
16
17    /// The processes entire output on its `stderr` stream, collected into individual lines.
18    ///
19    /// Depending on the [`crate::LineParsingOptions`] used, content might have been lost.
20    pub stderr: Vec<String>,
21}
22
23/// Full raw byte output of a process that terminated.
24///
25/// Both its `stdout` and `stderr` streams were collected as bytes without line parsing.
26#[derive(Debug, Clone, PartialEq, Eq)]
27pub struct RawOutput {
28    /// Status the process exited with.
29    pub status: ExitStatus,
30
31    /// The process's entire output on its `stdout` stream, collected as raw bytes.
32    pub stdout: Vec<u8>,
33
34    /// The process's entire output on its `stderr` stream, collected as raw bytes.
35    pub stderr: Vec<u8>,
36}