#[non_exhaustive]pub enum Name {
}Expand description
Signal name
This enum identifies a signal by its name. It can be used to represent
signals regardless of whether they are available on the System.
Use the System::validate_signal function to obtain a Name from a
signal number. The System::signal_number_from_name function can be used
to convert a Name to a Number.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Abrt
SIGABRT (process abort signal)
Alrm
SIGALRM (alarm clock)
Bus
SIGBUS (access to an undefined portion of a memory object)
Chld
SIGCHLD (child process terminated, stopped, or continued)
Cld
SIGCLD (child process terminated, stopped, or continued)
Cont
SIGCONT (continue executing, if stopped)
Emt
SIGEMT (emulation trap)
Fpe
SIGFPE (erroneous arithmetic operation)
Hup
SIGHUP (hangup)
Ill
SIGILL (illegal instruction)
Info
SIGINFO (status request from keyboard)
Int
SIGINT (interrupt)
Io
SIGIO (I/O is possible on a file descriptor)
Iot
SIGIOT (I/O trap)
Kill
SIGKILL (kill)
Lost
SIGLOST (resource lost)
Pipe
SIGPIPE (write on a pipe with no one to read it)
Poll
SIGPOLL (pollable event)
Prof
SIGPROF (profiling timer expired)
Pwr
SIGPWR (power failure)
Quit
SIGQUIT (quit)
Segv
SIGSEGV (invalid memory reference)
Stkflt
SIGSTKFLT (stack fault)
Stop
SIGSTOP (stop executing)
Sys
SIGSYS (bad system call)
Term
SIGTERM (termination)
Thr
SIGTHR (thread interrupt)
Trap
SIGTRAP (trace trap)
Tstp
SIGTSTP (stop executing)
Ttin
SIGTTIN (background process attempting read)
Ttou
SIGTTOU (background process attempting write)
Urg
SIGURG (high bandwidth data is available at a socket)
Usr1
SIGUSR1 (user-defined signal 1)
Usr2
SIGUSR2 (user-defined signal 2)
Vtalrm
SIGVTALRM (virtual timer expired)
Winch
SIGWINCH (window size change)
Xcpu
SIGXCPU (CPU time limit exceeded)
Xfsz
SIGXFSZ (file size limit exceeded)
Rtmin(RawNumber)
Real-time signal with a number relative to the minimum real-time signal
Rtmin(n) represents the real-time signal SIGRTMIN + n, where n is
expected to be a non-negative integer between 0 and
SIGRTMAX - SIGRTMIN.
Rtmax(RawNumber)
Real-time signal with a number relative to the maximum real-time signal
Rtmax(n) represents the real-time signal SIGRTMAX + n, where n is
expected to be a non-positive integer between SIGRTMIN - SIGRTMAX and
0.
Implementations§
Source§impl Name
impl Name
Sourcepub fn iter() -> NameIter ⓘ
pub fn iter() -> NameIter ⓘ
Returns an iterator over all signal names.
This is a convenience method that returns an iterator over all signal
names. The iterator yields all signal names other than Rtmin and
Rtmax in the alphabetical order, followed by Rtmin(0) and Rtmax(0)
as the last two items.
Note that the iterator works independently of the underlying system and does not check whether the signals are available on the system.
Sourcepub fn as_string(&self) -> Cow<'static, str>
pub fn as_string(&self) -> Cow<'static, str>
Returns the name as a string.
For most signals, this function returns a static string that is the
signal name in uppercase without the "SIG" prefix. For real-time
signals Rtmin(n) and Rtmax(n) where n is non-zero, this function
returns a dynamically allocated string that is RTMIN or RTMAX
followed by the relative number n. Examples of the returned strings
are "TERM", "RTMIN", and "RTMAX-5".
The returned name can be converted back to the signal using the
FromStr implementation for Name.
Trait Implementations§
Source§impl FromStr for Name
Parses a signal name from a string.
impl FromStr for Name
Parses a signal name from a string.
This function parses a signal name from a string. The input string is
expected to be an uppercase signal name without the "SIG" prefix. The
function returns the corresponding signal name if the input string matches a
known signal name. Otherwise, it returns an error.
See Name::as_string for the format of the input string.
Source§impl PartialOrd for Name
Compares two signal names.
impl PartialOrd for Name
Compares two signal names.
The comparison is allowed only between two Rtmin values or two Rtmax
values. The comparison is based on the numerical value of the signal number.
impl Copy for Name
impl Eq for Name
impl StructuralPartialEq for Name
Auto Trait Implementations§
impl Freeze for Name
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnwindSafe for Name
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more