Enum sysexit::Code [] [src]

#[repr(i32)]
pub enum Code { Success, Failure, Unknown, Usage, DataErr, NoInput, NoUser, NoHost, Unavailable, Software, OsErr, OsFile, CantCreat, IoErr, TempFail, Protocol, NoPerm, Config, NotExecutable, NotFound, SIGHUP, SIGINT, SIGKILL, SIGPIPE, SIGALRM, SIGTERM, SIGUSR1, SIGUSR2, SIGVTALRM, }

A successful exit is always indicated by a status of 0, or exit::Success. Exit codes greater than zero indicates failure.

Variants

The process exited successfully.

Generic failure.

Catch-all exit code when the process exits for an unknown reason.

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

The input data was incorrect in some way. This should only be used for user’s data and not system files.

An input file (not a system file) did not exist or was not readable. This could also include erros like “No message” to a mailer (if it cared to catch it).

The user specified did not exist. This might be used for mail adresses or remote logins.

The host specified did not exist. This is used in mail addresses or network requests.

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

An internal software error has been detected. This should be limited to non-operating system related errors if possible.

An operating system error has been detected. This is intended to be used for such things as “cannot fork”, or “cannot create pipe”. It includes things like getuid(2) returning a user that does not exist in the passwd file.

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

A (user specified) output file cannot be created.

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

Temporary failure, indicating something that is not really an error. For example that a mailer could not create a connection, and the request should be reattempted later.

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

You did not have sufficient permission to perform the operation. This is not intended for file system problems, which should use NoInput or CantCreat, but rather for high level permissions.

Something was found in an unconfigured or misconfigured state.

Command was found but is not executable by the shell.

Usually indicates that the command was not found by the shell, or that the command is found but that a library it requires is not found.

The SIGHUP signal is sent to a process when its controlling terminal is closed.

The SIGINT signal is sent to a process by its controlling terminal when a user wishes to interrupt the process.

The SIGKILL signal is sent to a process to cause it to terminate immediately. In contrast to SIGTERM and SIGINT, this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal.

The SIGPIPE signal is sent to a process when it attempts to write to a pipe without a process connected to the other end.

The SIGALRM signal is sent to a process when the time limit specified in a call to a preceding alarm setting function (such as setitimer) elapses.

The SIGTERM signal is sent to a process to request its termination. Unlike the SIGKILL signal, it can be caught and interpreted or ignored by the process.

The SIGUSR1 signal, like SIGUSR2, is sent to a process to indicate a user-defined condition.

The SIGUSR2 signal, like SIGUSR1, is sent to a process to indicate a user-defined condition.

The SIGVTALRM signal is sent to a process when the time limit specified for the virtual alarm elapses.

Trait Implementations

impl Clone for Code
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Code
[src]

impl Debug for Code
[src]

[src]

Formats the value using the given formatter.

impl Eq for Code
[src]

impl PartialEq for Code
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl From<i32> for Code
[src]

Converts an i32 primitive integer to an exit code.

[src]

Performs the conversion.

impl From<Option<i32>> for Code
[src]

[src]

Performs the conversion.

impl From<ExitStatus> for Code
[src]

Converts std::process::ExitStatus to an exit code by looking at its ExitStatus::code() value.

On Unix, if the process was terminated by a fatal signal, the corresponding signal exit code is returned. If the passed exit status cannot be determined, exit::Unknown (2) is returned.

[src]

Performs the conversion.

impl Display for Code
[src]

Provides a user-friendly explanation of the exit code.

[src]

Formats the value using the given formatter. Read more