// representation of an ExitCode
//
// More info: https://internals.rust-lang.org/t/mini-pre-rfc-redesigning-process-exitstatus/5426
- #[unstable(feature = "process_exitcode_placeholder", issue = "48711")]
/// Convert an ExitCode into an i32
+ #[unstable(feature = "process_exitcode_placeholder", issue = "48711")]
+ #[inline]
pub fn to_i32(self) -> i32 {
self.0.as_i32()
}
}
+#[unstable(feature = "process_exitcode_placeholder", issue = "48711")]
+impl From<u8> for ExitCode {
+ /// Construct an exit code from an arbitrary u8 value.
+ fn from(code: u8) -> Self {
+ ExitCode(imp::ExitCode::from(code))
+ }
+}
+
impl Child {
/// Forces the child process to exit. If the child has already exited, an [`InvalidInput`]
/// error is returned.