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

SIGHUP

Source

pub const INT: Self

SIGINT

Source

pub const QUIT: Self

SIGQUIT

Source

pub const ILL: Self

SIGILL

Source

pub const TRAP: Self

SIGTRAP

Source

pub const ABORT: Self

SIGABRT, aka SIGIOT

Source

pub const BUS: Self

SIGBUS

Source

pub const FPE: Self

SIGFPE

Source

pub const KILL: Self

SIGKILL

Source

pub const USR1: Self

SIGUSR1

Source

pub const SEGV: Self

SIGSEGV

Source

pub const USR2: Self

SIGUSR2

Source

pub const PIPE: Self

SIGPIPE

Source

pub const ALARM: Self

SIGALRM

Source

pub const TERM: Self

SIGTERM

Source

pub const STKFLT: Self

SIGSTKFLT

Source

pub const CHILD: Self

SIGCHLD

Source

pub const CONT: Self

SIGCONT

Source

pub const STOP: Self

SIGSTOP

Source

pub const TSTP: Self

SIGTSTP

Source

pub const TTIN: Self

SIGTTIN

Source

pub const TTOU: Self

SIGTTOU

Source

pub const URG: Self

SIGURG

Source

pub const XCPU: Self

SIGXCPU

Source

pub const XFSZ: Self

SIGXFSZ

Source

pub const VTALARM: Self

SIGVTALRM

Source

pub const PROF: Self

SIGPROF

Source

pub const WINCH: Self

SIGWINCH

Source

pub const IO: Self

SIGIO, aka SIGPOLL

Source

pub const POWER: Self

SIGPWR

Source

pub const SYS: Self

SIGSYS, aka SIGUNUSED

Source§

impl Signal

Source

pub const fn as_raw(self) -> i32

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

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

Source

pub const unsafe fn from_raw_unchecked(sig: i32) -> Self

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

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>

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>

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

Source§

fn clone(&self) -> Signal

Returns a copy 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

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Signal

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

Source§

impl Eq for Signal

Source§

impl StructuralPartialEq for Signal

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.