Struct cradle::output::Status[][src]

pub struct Status(pub ExitStatus);
Expand description

Use Status as the return type for run_output! to retrieve the ExitStatus of the child process:

use cradle::prelude::*;

let Status(exit_status) = run_output!(%"echo foo");
assert!(exit_status.success());

Also, when using Status, non-zero exit codes won’t result in neither a panic nor a std::result::Result::Err:

use cradle::prelude::*;

let Status(exit_status) = run_output!("false");
assert_eq!(exit_status.code(), Some(1));
let result: Result<Status, cradle::Error> = run_result!("false");
assert!(result.is_ok());
assert_eq!(result.unwrap().0.code(), Some(1));

Also see the section about error handling in the module documentation.

Tuple Fields

0: ExitStatus

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.