pub struct ProcessRunnerOutput { /* private fields */ }Expand description
Bounded output returned by a process runner.
Process output is an opaque byte stream. The runner keeps the exact bounded bytes and a loss-tolerant UTF-8 view separately so binary tools cannot turn a successful process into an infrastructure error merely by writing invalid UTF-8. Internal execution audit evidence stores byte counts and truncation flags, not these payloads.
Implementations§
Source§impl ProcessRunnerOutput
impl ProcessRunnerOutput
Sourcepub fn new(
intent: &ProcessActionIntent,
status: ProcessExitStatus,
stdout_text: impl Into<String>,
stdout_truncated: bool,
stderr_text: impl Into<String>,
stderr_truncated: bool,
) -> Result<Self, ProcessActionError>
pub fn new( intent: &ProcessActionIntent, status: ProcessExitStatus, stdout_text: impl Into<String>, stdout_truncated: bool, stderr_text: impl Into<String>, stderr_truncated: bool, ) -> Result<Self, ProcessActionError>
Creates validated process runner output for a previously validated intent.
Sourcepub fn from_bytes(
intent: &ProcessActionIntent,
status: ProcessExitStatus,
stdout_data: Vec<u8>,
stdout_truncated: bool,
stderr_data: Vec<u8>,
stderr_truncated: bool,
) -> Result<Self, ProcessActionError>
pub fn from_bytes( intent: &ProcessActionIntent, status: ProcessExitStatus, stdout_data: Vec<u8>, stdout_truncated: bool, stderr_data: Vec<u8>, stderr_truncated: bool, ) -> Result<Self, ProcessActionError>
Creates output from exact bounded process bytes.
Sourcepub fn with_running_pid(self, pid: u32) -> Self
pub fn with_running_pid(self, pid: u32) -> Self
Records the pid of a process that is still running.
Sourcepub fn with_background_process_id(self, id: BackgroundProcessId) -> Self
pub fn with_background_process_id(self, id: BackgroundProcessId) -> Self
Records the id of a process retained after this call returns.
Sourcepub fn with_wait_timed_out_secs(self, secs: u64) -> Self
pub fn with_wait_timed_out_secs(self, secs: u64) -> Self
Records that a foreground wait elapsed after secs seconds without killing
the still-running process, handing it off to the background supervisor.
Sourcepub const fn status(&self) -> ProcessExitStatus
pub const fn status(&self) -> ProcessExitStatus
Returns the provider-neutral completion status.
Sourcepub fn stdout_text(&self) -> &str
pub fn stdout_text(&self) -> &str
Returns bounded stdout payload for the result artifact.
Sourcepub fn stdout_data(&self) -> &[u8] ⓘ
pub fn stdout_data(&self) -> &[u8] ⓘ
Returns the exact bounded stdout bytes.
Sourcepub fn stdout_is_utf8(&self) -> bool
pub fn stdout_is_utf8(&self) -> bool
Returns whether stdout was valid UTF-8 without replacement.
Sourcepub const fn stdout_bytes(&self) -> usize
pub const fn stdout_bytes(&self) -> usize
Returns captured stdout byte count.
Sourcepub const fn stdout_truncated(&self) -> bool
pub const fn stdout_truncated(&self) -> bool
Returns whether stdout capture was truncated.
Sourcepub fn stderr_text(&self) -> &str
pub fn stderr_text(&self) -> &str
Returns bounded stderr payload for the result artifact.
Sourcepub fn stderr_data(&self) -> &[u8] ⓘ
pub fn stderr_data(&self) -> &[u8] ⓘ
Returns the exact bounded stderr bytes.
Sourcepub fn stderr_is_utf8(&self) -> bool
pub fn stderr_is_utf8(&self) -> bool
Returns whether stderr was valid UTF-8 without replacement.
Sourcepub const fn stderr_bytes(&self) -> usize
pub const fn stderr_bytes(&self) -> usize
Returns captured stderr byte count.
Sourcepub const fn stderr_truncated(&self) -> bool
pub const fn stderr_truncated(&self) -> bool
Returns whether stderr capture was truncated.
Sourcepub const fn running_pid(&self) -> Option<u32>
pub const fn running_pid(&self) -> Option<u32>
Returns the pid when the process is still running.
Sourcepub fn background_process_id(&self) -> Option<&BackgroundProcessId>
pub fn background_process_id(&self) -> Option<&BackgroundProcessId>
Returns the id of a process retained after this call returns.
Sourcepub const fn wait_timed_out_secs(&self) -> Option<u64>
pub const fn wait_timed_out_secs(&self) -> Option<u64>
Returns the foreground wait timeout in seconds when the call handed off a still-running command to the background without killing it.
Sourcepub const fn ok(&self) -> bool
pub const fn ok(&self) -> bool
Returns whether the process output represents successful completion.
A process that is still running counts as success so the turn can continue.
Sourcepub fn execution_evidence(
&self,
intent: &ProcessActionIntent,
permission_profile_id: ProcessPermissionProfileId,
) -> Result<ProcessExecutionEvidence, ProcessActionError>
pub fn execution_evidence( &self, intent: &ProcessActionIntent, permission_profile_id: ProcessPermissionProfileId, ) -> Result<ProcessExecutionEvidence, ProcessActionError>
Builds payload-free internal execution evidence for the given intent.
Trait Implementations§
Source§impl Clone for ProcessRunnerOutput
impl Clone for ProcessRunnerOutput
Source§impl Debug for ProcessRunnerOutput
impl Debug for ProcessRunnerOutput
impl Eq for ProcessRunnerOutput
Source§impl PartialEq for ProcessRunnerOutput
impl PartialEq for ProcessRunnerOutput
impl StructuralPartialEq for ProcessRunnerOutput
Auto Trait Implementations§
impl Forget for ProcessRunnerOutput
impl Freeze for ProcessRunnerOutput
impl Move for ProcessRunnerOutput
impl RefUnwindSafe for ProcessRunnerOutput
impl Send for ProcessRunnerOutput
impl Sync for ProcessRunnerOutput
impl Unpin for ProcessRunnerOutput
impl UnsafeUnpin for ProcessRunnerOutput
impl UnwindSafe for ProcessRunnerOutput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.