1
Fork 0

Implement ExitCodeExt for Windows

This commit is contained in:
Aron Parker 2022-06-09 15:29:58 +02:00
parent 6dc598a01b
commit 0503bc0149
3 changed files with 41 additions and 0 deletions

View file

@ -1708,6 +1708,10 @@ impl crate::error::Error for ExitStatusError {}
#[stable(feature = "process_exitcode", since = "1.61.0")]
pub struct ExitCode(imp::ExitCode);
/// Allows extension traits within `std`.
#[unstable(feature = "sealed", issue = "none")]
impl crate::sealed::Sealed for ExitCode {}
#[stable(feature = "process_exitcode", since = "1.61.0")]
impl ExitCode {
/// The canonical `ExitCode` for successful termination on this platform.
@ -1798,6 +1802,18 @@ impl From<u8> for ExitCode {
}
}
impl AsInner<imp::ExitCode> for ExitCode {
fn as_inner(&self) -> &imp::ExitCode {
&self.0
}
}
impl FromInner<imp::ExitCode> for ExitCode {
fn from_inner(s: imp::ExitCode) -> ExitCode {
ExitCode(s)
}
}
impl Child {
/// Forces the child process to exit. If the child has already exited, an [`InvalidInput`]
/// error is returned.