pub struct ExitCode(/* private fields */);Expand description
A portable process exit code primitive.
Implementations§
Source§impl ExitCode
impl ExitCode
Sourcepub fn try_from_i32(code: i32) -> Result<ExitCode, ExitCodeError>
pub fn try_from_i32(code: i32) -> Result<ExitCode, ExitCodeError>
Creates an exit code from an i32 when it fits in u8.
§Errors
Returns ExitCodeError::OutOfRange when code is outside 0..=255.
Sourcepub const fn is_success(self) -> bool
pub const fn is_success(self) -> bool
Returns whether this is a success exit code.
Trait Implementations§
Source§impl Ord for ExitCode
impl Ord for ExitCode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for ExitCode
impl PartialOrd for ExitCode
impl Copy for ExitCode
impl Eq for ExitCode
impl StructuralPartialEq for ExitCode
Auto Trait Implementations§
impl Freeze for ExitCode
impl RefUnwindSafe for ExitCode
impl Send for ExitCode
impl Sync for ExitCode
impl Unpin for ExitCode
impl UnsafeUnpin for ExitCode
impl UnwindSafe for ExitCode
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