Enum clientele::SysexitsError

source ·
#[repr(u8)]
pub enum SysexitsError {
Show 16 variants EX_OK = 0, EX_USAGE = 64, EX_DATAERR = 65, EX_NOINPUT = 66, EX_NOUSER = 67, EX_NOHOST = 68, EX_UNAVAILABLE = 69, EX_SOFTWARE = 70, EX_OSERR = 71, EX_OSFILE = 72, EX_CANTCREAT = 73, EX_IOERR = 74, EX_TEMPFAIL = 75, EX_PROTOCOL = 76, EX_NOPERM = 77, EX_CONFIG = 78,
}
Expand description

Standard <sysexits.h> preferable exit codes for programs on Unix systems.

Quoting the rationale given in the sysexits(3) man page on BSD systems:

According to style(9), it is not a good practice to call exit(3) with arbitrary values to indicate a failure condition when ending a program. Instead, the pre-defined exit codes from sysexits should be used, so the caller of the process can get a rough estimation about the failure class without looking up the source code.

Variants§

§

EX_OK = 0

Successful termination.

§

EX_USAGE = 64

The command was used incorrectly, e.g., with the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.

§

EX_DATAERR = 65

The input data was incorrect in some way.

This should only be used for user’s data and not system files.

§

EX_NOINPUT = 66

An input file (not a system file) did not exist or was not readable.

This could also include errors like “No message” to a mailer (if it cared to catch it).

§

EX_NOUSER = 67

The user specified did not exist.

This might be used for mail addresses or remote logins.

§

EX_NOHOST = 68

The host specified did not exist.

This is used in mail addresses or network requests.

§

EX_UNAVAILABLE = 69

A service is unavailable.

This can occur if a support program or file does not exist. This can also be used as a catchall message when something you wanted to do doesn’t work, but you don’t know why.

§

EX_SOFTWARE = 70

An internal software error has been detected.

This should be limited to non-operating system related errors as possible.

§

EX_OSERR = 71

An operating system error has been detected.

This is intended to be used for such things as “cannot fork”, “cannot create pipe”, or the like. It includes things like getuid returning a user that does not exist in the /etc/passwd file.

§

EX_OSFILE = 72

Some system file (e.g., /etc/passwd, /var/run/utmp, etc.) does not exist, cannot be opened, or has some sort of error (e.g., syntax error).

§

EX_CANTCREAT = 73

A (user specified) output file cannot be created.

§

EX_IOERR = 74

An error occurred while doing I/O on some file.

§

EX_TEMPFAIL = 75

Temporary failure, indicating something that is not really an error.

In sendmail, this means that a mailer (e.g.) could not create a connection, and the request should be reattempted later.

§

EX_PROTOCOL = 76

The remote system returned something that was “not possible” during a protocol exchange.

§

EX_NOPERM = 77

You did not have sufficient permission to perform the operation.

This is not intended for file system problems, which should use EX_NOINPUT or EX_CANTCREAT, but rather for higher level permissions.

§

EX_CONFIG = 78

Something was found in an unconfigured or misconfigured state.

Implementations§

source§

impl SysexitsError

source

pub fn is_success(&self) -> bool

source

pub fn is_failure(&self) -> bool

source

pub fn as_u8(&self) -> u8

source

pub fn as_i32(&self) -> i32

source

pub fn as_str(&self) -> &'static str

source

pub fn as_exit_code(&self) -> ExitCode

source

pub fn code(&self) -> Option<i32>

source

pub fn name(&self) -> &'static str

source

pub fn summary(&self) -> &'static str

Trait Implementations§

source§

impl Clone for SysexitsError

source§

fn clone(&self) -> SysexitsError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SysexitsError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SysexitsError

source§

fn default() -> SysexitsError

Returns the “default value” for a type. Read more
source§

impl Display for SysexitsError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for SysexitsError

1.30.0 · source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
source§

impl From<Box<dyn Error>> for SysexitsError

source§

fn from(error: Box<dyn Error>) -> Self

Converts to this type from the input type.
source§

impl From<Error> for SysexitsError

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl FromStr for SysexitsError

§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(input: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for SysexitsError

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for SysexitsError

source§

fn cmp(&self, other: &SysexitsError) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for SysexitsError

source§

fn eq(&self, other: &SysexitsError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for SysexitsError

source§

fn partial_cmp(&self, other: &SysexitsError) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Termination for SysexitsError

source§

fn report(self) -> ExitCode

Is called to get the representation of the value as status code. This status code is returned to the operating system.
source§

impl TryFrom<ExitStatus> for SysexitsError

§

type Error = Option<i32>

The type returned in the event of a conversion error.
source§

fn try_from(status: ExitStatus) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i32> for SysexitsError

§

type Error = i32

The type returned in the event of a conversion error.
source§

fn try_from(code: i32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<u8> for SysexitsError

§

type Error = u8

The type returned in the event of a conversion error.
source§

fn try_from(code: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for SysexitsError

source§

impl Eq for SysexitsError

source§

impl StructuralPartialEq for SysexitsError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more