Struct cargo_util::ProcessError
source · [−]pub struct ProcessError {
pub desc: String,
pub code: Option<i32>,
pub stdout: Option<Vec<u8>>,
pub stderr: Option<Vec<u8>>,
}
Fields
desc: String
A detailed description to show to the user why the process failed.
code: Option<i32>
The exit status of the process.
This can be None
if the process failed to launch (like process not
found) or if the exit status wasn’t a code but was instead something
like termination via a signal.
stdout: Option<Vec<u8>>
The stdout from the process.
This can be None
if the process failed to launch, or the output was
not captured.
stderr: Option<Vec<u8>>
The stderr from the process.
This can be None
if the process failed to launch, or the output was
not captured.
Implementations
sourceimpl ProcessError
impl ProcessError
sourcepub fn new(
msg: &str,
status: Option<ExitStatus>,
output: Option<&Output>
) -> ProcessError
pub fn new(
msg: &str,
status: Option<ExitStatus>,
output: Option<&Output>
) -> ProcessError
Creates a new ProcessError
.
status
can beNone
if the process did not launch.output
can beNone
if the process did not launch, or output was not captured.
sourcepub fn new_raw(
msg: &str,
code: Option<i32>,
status: &str,
stdout: Option<&[u8]>,
stderr: Option<&[u8]>
) -> ProcessError
pub fn new_raw(
msg: &str,
code: Option<i32>,
status: &str,
stdout: Option<&[u8]>,
stderr: Option<&[u8]>
) -> ProcessError
Creates a new ProcessError
with the raw output data.
code
can beNone
for situations like being killed by a signal on unix.
sourcepub fn could_not_execute(cmd: impl Display) -> ProcessError
pub fn could_not_execute(cmd: impl Display) -> ProcessError
Creates a ProcessError
with “could not execute process {cmd}”.
cmd
is usually but not limited tostd::process::Command
.
Trait Implementations
sourceimpl Debug for ProcessError
impl Debug for ProcessError
sourceimpl Display for ProcessError
impl Display for ProcessError
sourceimpl Error for ProcessError
impl Error for ProcessError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations
impl RefUnwindSafe for ProcessError
impl Send for ProcessError
impl Sync for ProcessError
impl Unpin for ProcessError
impl UnwindSafe for ProcessError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more