Signal

Struct Signal 

Source
pub struct Signal(/* private fields */);
Available on crate feature 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

Source

pub 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.

SIGHUP

Source

pub 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.

SIGINT

Source

pub 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.

SIGQUIT

Source

pub 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.

SIGILL

Source

pub 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.

SIGTRAP

Source

pub 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.

SIGABRT, aka SIGIOT

Source

pub 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.

SIGBUS

Source

pub 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.

SIGFPE

Source

pub 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.

SIGKILL

Source

pub 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.

SIGUSR1

Source

pub 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.

SIGSEGV

Source

pub 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.

SIGUSR2

Source

pub 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.

SIGPIPE

Source

pub 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.

SIGALRM

Source

pub 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.

SIGTERM

Source

pub 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.

SIGSTKFLT

Source

pub 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.

SIGCHLD

Source

pub 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.

SIGCONT

Source

pub 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.

SIGSTOP

Source

pub 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.

SIGTSTP

Source

pub 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.

SIGTTIN

Source

pub 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.

SIGTTOU

Source

pub 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.

SIGURG

Source

pub 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.

SIGXCPU

Source

pub 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.

SIGXFSZ

Source

pub 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.

SIGVTALRM

Source

pub 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.

SIGPROF

Source

pub 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.

SIGWINCH

Source

pub 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.

SIGIO, aka SIGPOLL

Source

pub const POWER: 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 Haiku nor target_os=horizon nor target_os=hurd nor target_os=vita only.

SIGPWR

Source

pub const SYS: 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.

SIGSYS, aka SIGUNUSED

Source§

impl Signal

Source

pub 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.

Convert a Signal to a raw signal number.

To convert to a NonZeroI32, use Signal::as_raw_nonzero.

Source

pub 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.

Convert a Signal to a raw non-zero signal number.

Source

pub 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.

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.

Source

pub 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.

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.

Source

pub 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.

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.

Source

pub 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.

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.
Source§

fn clone(&self) -> Signal

Returns a duplicate 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 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.
Source§

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

Formats the value using the given formatter. Read more
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.
Source§

fn eq(&self, other: &Signal) -> 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 Copy 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.
Source§

impl Eq 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.
Source§

impl StructuralPartialEq 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.

Auto Trait Implementations§

§

impl Freeze for Signal

§

impl RefUnwindSafe for Signal

§

impl Send for Signal

§

impl Sync for Signal

§

impl Unpin for Signal

§

impl UnwindSafe for Signal

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.