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
Success
The process exited successfully.
Failure
Generic failure.
Unknown
Catch-all exit code when the process exits for an unknown reason.
Usage
The command was used incorrectly, e.g. with the wrong number of arguments, a bad flag, bad syntax in a parameter, or whatever.
DataErr
The input data was incorrect in some way. This should only be used for user’s data and not system files.
NoInput
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).
NoUser
The user specified did not exist. This might be used for mail adresses or remote logins.
NoHost
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.
Software
An internal software error has been detected. This should be limited to non-operating system related errors if possible.
OsErr
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.
OsFile
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).
CantCreat
A (user specified) output file cannot be created.
IoErr
An error occurred while doing I/O on some file.
TempFail
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.
Protocol
The remote system returned something that was “not possible” during a protocol exchange.
NoPerm
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.
Config
Something was found in an unconfigured or misconfigured state.
NotExecutable
Command was found but is not executable by the shell.
NotFound
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.
SIGHUP
The SIGHUP
signal is sent to a process when its controlling terminal
is closed.
SIGINT
The SIGINT
signal is sent to a process by its controlling terminal
when a user wishes to interrupt the process.
SIGKILL
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.
SIGPIPE
The SIGPIPE
signal is sent to a process when it attempts to write to
a pipe without a process connected to the other end.
SIGALRM
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.
SIGTERM
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.
SIGUSR1
The SIGUSR1
signal, like SIGUSR2
, is sent to a process to indicate
a user-defined condition.
SIGUSR2
The SIGUSR2
signal, like SIGUSR1
, is sent to a process to indicate
a user-defined condition.
SIGVTALRM
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]
fn clone(&self) -> Code
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Code
[src]
impl Debug for Code
[src]
impl Eq for Code
[src]
impl PartialEq for Code
[src]
fn eq(&self, __arg_0: &Code) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl From<i32> for Code
[src]
Converts an i32
primitive integer to an exit code.
impl From<Option<i32>> for Code
[src]
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.
fn from(status: ExitStatus) -> Self
[src]
Performs the conversion.
impl From<ErrorKind> for Code
[src]
impl Display for Code
[src]
Provides a user-friendly explanation of the exit code.