pub struct ExecResult {
pub stdout: String,
pub stderr: String,
pub exit_code: i32,
pub command: String,
}Expand description
The captured result of running a command in a guest through the local CLI.
Returned by crate::Sandbox::exec and the command builder’s run().
Fields§
§stdout: String§stderr: String§exit_code: i32§command: StringA short label for what ran, used in Error::CommandFailed.
Implementations§
Source§impl ExecResult
impl ExecResult
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T>
pub fn json<T: DeserializeOwned>(&self) -> Result<T>
Parse stdout as JSON into any deserializable type.
Sourcepub fn ok_or_err(self) -> Result<ExecResult>
pub fn ok_or_err(self) -> Result<ExecResult>
A non-zero exit becomes Error::CommandFailed; exit 0 passes the
result through, so it chains: sandbox.exec([...])?.ok_or_err()?.
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 (const: unstable) · 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
impl Eq for ExecResult
Source§impl PartialEq for ExecResult
impl PartialEq for ExecResult
impl StructuralPartialEq for ExecResult
Auto Trait Implementations§
impl Freeze for ExecResult
impl RefUnwindSafe for ExecResult
impl Send for ExecResult
impl Sync for ExecResult
impl Unpin for ExecResult
impl UnsafeUnpin 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