pub struct Signal(/* private fields */);io_uring only.Expand description
A signal number for use with kill_process, kill_process_group, and
kill_current_process_group.
For additional constructors such as Signal::rt_min
(aka libc::SIGRTMIN), Signal::rt_max (aka libc::SIGRTMAX),
Signal::rt (aka |n| libc::SIGRTMIN() + n), Signal::from_raw, and
Signal::from_raw_nonzero, see rustix-libc-wrappers.
§References
Implementations§
Source§impl Signal
impl Signal
Sourcepub const HUP: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const HUP: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGHUP
Sourcepub const INT: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const INT: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGINT
Sourcepub const QUIT: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const QUIT: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGQUIT
Sourcepub const ILL: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const ILL: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGILL
Sourcepub const TRAP: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const TRAP: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGTRAP
Sourcepub const ABORT: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const ABORT: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGABRT, aka SIGIOT
Sourcepub const BUS: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const BUS: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGBUS
Sourcepub const FPE: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const FPE: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGFPE
Sourcepub const KILL: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const KILL: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGKILL
Sourcepub const USR1: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const USR1: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGUSR1
Sourcepub const SEGV: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const SEGV: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGSEGV
Sourcepub const USR2: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const USR2: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGUSR2
Sourcepub const PIPE: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const PIPE: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGPIPE
Sourcepub const ALARM: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const ALARM: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGALRM
Sourcepub const TERM: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const TERM: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.SIGTERM
Sourcepub const STKFLT: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and neither bsd, nor solarish, nor target_os=aix, nor Cygwin, nor Haiku, nor target_os=horizon, nor target_os=hurd, nor target_os=nto, nor target_os=vita, nor linux_kernel and (MIPS or MIPS Release 6 or MIPS-64 or MIPS-64 Release 6 or target_arch=sparc or SPARC64) only.
pub const STKFLT: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and neither bsd, nor solarish, nor target_os=aix, nor Cygwin, nor Haiku, nor target_os=horizon, nor target_os=hurd, nor target_os=nto, nor target_os=vita, nor linux_kernel and (MIPS or MIPS Release 6 or MIPS-64 or MIPS-64 Release 6 or target_arch=sparc or SPARC64) only.SIGSTKFLT
Sourcepub const CHILD: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const CHILD: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGCHLD
Sourcepub const CONT: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const CONT: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGCONT
Sourcepub const STOP: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const STOP: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGSTOP
Sourcepub const TSTP: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const TSTP: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGTSTP
Sourcepub const TTIN: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const TTIN: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGTTIN
Sourcepub const TTOU: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const TTOU: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGTTOU
Sourcepub const URG: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const URG: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGURG
Sourcepub const XCPU: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const XCPU: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGXCPU
Sourcepub const XFSZ: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const XFSZ: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGXFSZ
Sourcepub const VTALARM: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const VTALARM: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGVTALRM
Sourcepub const PROF: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const PROF: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGPROF
Sourcepub const WINCH: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.
pub const WINCH: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and non-target_os=vita only.SIGWINCH
Sourcepub const IO: Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and neither Haiku nor target_os=vita only.
pub const IO: Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) and neither Haiku nor target_os=vita only.SIGIO, aka SIGPOLL
Source§impl Signal
impl Signal
Sourcepub const fn as_raw(self) -> i32
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const fn as_raw(self) -> i32
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Convert a Signal to a raw signal number.
To convert to a NonZeroI32, use Signal::as_raw_nonzero.
Sourcepub const fn as_raw_nonzero(self) -> NonZeroI32
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const fn as_raw_nonzero(self) -> NonZeroI32
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Convert a Signal to a raw non-zero signal number.
Sourcepub const unsafe fn from_raw_unchecked(sig: i32) -> Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const unsafe fn from_raw_unchecked(sig: i32) -> Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Convert a raw signal number into a Signal without checks.
For a safe checked version, see Signal::from_raw in
rustix-libc-wrappers.
§Safety
sig must be a valid and non-zero signal number.
And, if sig is a signal number reserved by the libc, such as a value
from the libc SIGRTMIN to the libc SIGRTMAX, inclusive, then
the resulting Signal must not be used to send, consume, or block any
signals or alter any signal handlers.
Sourcepub const unsafe fn from_raw_nonzero_unchecked(sig: NonZeroI32) -> Self
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const unsafe fn from_raw_nonzero_unchecked(sig: NonZeroI32) -> Self
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Convert a raw non-zero signal number into a Signal without checks.
For a safe checked version, see Signal::from_raw_nonzero in
rustix-libc-wrappers.
§Safety
sig must be a valid signal number.
And, if sig is a signal number reserved by the libc, such as a value
from SIGRTMIN to SIGRTMAX inclusive, then the resulting
Signal must not be used to send, consume, or block any signals or
alter any signal handlers.
Sourcepub const fn from_named_raw(sig: i32) -> Option<Self>
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const fn from_named_raw(sig: i32) -> Option<Self>
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Convert a raw named signal number into a Signal.
If the given signal number corresponds to one of the named constant
signal values, such as Signal::HUP or Signal::INT, return the
Signal value. Otherwise return None.
Signals in the range SIGRTMIN through SIGRTMAX are not supported by
this function. For a constructor that does recognize those values, see
Signal::from_raw in rustix-libc-wrappers.
Sourcepub const fn from_named_raw_nonzero(sig: NonZeroI32) -> Option<Self>
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
pub const fn from_named_raw_nonzero(sig: NonZeroI32) -> Option<Self>
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Convert a raw non-zero named signal number into a Signal.
If the given signal number corresponds to one of the constant signal
values, such as Signal::HUP or Signal::INT, return the
Signal value. Otherwise return None.
Signals in the range SIGRTMIN through SIGRTMAX are not supported by
this function. For a constructor that does recognize those values, see
Signal::from_raw_nonzero in rustix-libc-wrappers.
Trait Implementations§
Source§impl Clone for Signal
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
impl Clone for Signal
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Source§impl Debug for Signal
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
impl Debug for Signal
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.Source§impl PartialEq for Signal
Available on neither Windows nor target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.
impl PartialEq for Signal
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.impl Copy for Signal
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.impl Eq for Signal
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.impl StructuralPartialEq for Signal
target_os=espidf nor WASI and (crate feature io_uring, or crate feature process, or crate feature runtime, or bsd and crate feature event) only.