pub struct ExitCode(pub i32);Expand description
A special error type that does not print any message when returned from
uumain. Especially useful for porting utilities to using UResult.
There are two ways to construct an ExitCode:
use uucore::error::{ExitCode, UResult};
// Explicit
let res: UResult<()> = Err(ExitCode(1).into());
// Using into on `i32`:
let res: UResult<()> = Err(1.into());This type is especially useful for a trivial conversion from utils returning i32 to
returning UResult.
Tuple Fields§
§0: i32Implementations§
Trait Implementations§
Source§impl Error for ExitCode
impl Error for ExitCode
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()
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