#[non_exhaustive]pub enum ProcResult {
Unix(WaitStatus),
Windows(ExitCode),
}
Expand description
An exit code or exit state returned by a program.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unix(WaitStatus)
An unclassified exit status on a Unix platform.
Windows(ExitCode)
An unclassified exit status on a Windows platform.
Implementations§
Source§impl ProcResult
impl ProcResult
Sourcepub fn ok(&self) -> Result<(), Self>
pub fn ok(&self) -> Result<(), Self>
Returns a result that is Ok
if the exit code or status indicates a success.
§Errors
Returns Self
if not ProcResult::is_success
.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns whether the process terminated successfully.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Returns whether the process did not terminate successfully.
Trait Implementations§
Source§impl Clone for ProcResult
impl Clone for ProcResult
Source§fn clone(&self) -> ProcResult
fn clone(&self) -> ProcResult
Returns a duplicate of the value. Read more
1.0.0 · 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 ProcResult
impl Debug for ProcResult
Source§impl Display for ProcResult
impl Display for ProcResult
Source§impl Error for ProcResult
impl Error for ProcResult
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ExitStatus> for ProcResult
impl From<ExitStatus> for ProcResult
Source§fn from(status: ExitStatus) -> Self
fn from(status: ExitStatus) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ProcResult
impl PartialEq for ProcResult
impl Copy for ProcResult
impl Eq for ProcResult
impl StructuralPartialEq for ProcResult
Auto Trait Implementations§
impl Freeze for ProcResult
impl RefUnwindSafe for ProcResult
impl Send for ProcResult
impl Sync for ProcResult
impl Unpin for ProcResult
impl UnwindSafe for ProcResult
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