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§
source§impl 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§
source§impl Debug for ProcessError
impl Debug for ProcessError
source§impl Display for ProcessError
impl Display for ProcessError
source§impl Error for ProcessError
impl Error for ProcessError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for ProcessError
impl RefUnwindSafe for ProcessError
impl Send for ProcessError
impl Sync for ProcessError
impl Unpin for ProcessError
impl UnwindSafe for ProcessError
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes