Struct SignalSetBuilder

Source
pub struct SignalSetBuilder { /* private fields */ }
Available on Unix only.
Expand description

Constructs a SignalSet using the builder pattern.

Signals that cannot be handled are not listed as methods.

Implementations§

Source§

impl SignalSetBuilder

Source

pub fn new() -> Self

Creates a new, empty signal set builder.

Source

pub const unsafe fn from_raw(signal_set: sigset_t) -> Self

Creates a new builder from the raw signal_set.

§Safety

This library assumes that all signals used are valid. Supplying an unsupported signal set invalidates this assumption.

Source

pub const fn into_raw(self) -> sigset_t

Returns the raw value of this signal set builder.

Source

pub fn termination_set(self) -> Self

The set of signals that result in process termination.

Source

pub fn alarm(self) -> Self

The SIGALRM signal; sent when a real-time timer expires.

Default behavior: process termination.

Source

pub fn child(self) -> Self

The SIGCHLD signal; sent when the status of a child process changes.

Default behavior: ignored.

Source

pub fn hangup(self) -> Self

The SIGHUP signal; sent when the terminal is disconnected.

Default behavior: process termination.

Source

pub fn info(self) -> Self

The SIGINFO signal; sent to request a status update from the process.

Not supported on: android, emscripten, linux.

Keyboard shortcut: CTRL + T.

Default behavior: ignored.

Source

pub fn interrupt(self) -> Self

The SIGINT signal; sent to interrupt a program.

Keyboard shortcut: CTRL + C.

Default behavior: process termination.

Source

pub fn io(self) -> Self

The SIGIO signal; sent when I/O operations are possible on some file descriptor.

Default behavior: ignored.

Source

pub fn pipe(self) -> Self

The SIGPIPE signal; sent when the process attempts to write to a pipe which has no reader.

Default behavior: process termination.

Source

pub fn quit(self) -> Self

The SIGQUIT signal; sent to issue a shutdown of the process, after which the OS will dump the process core.

Keyboard shortcut: CTRL + \.

Default behavior: process termination.

Source

pub fn terminate(self) -> Self

The SIGTERM signal; sent to issue a shutdown of the process.

Default behavior: process termination.

Source

pub fn user_defined_1(self) -> Self

The SIGUSR1 signal; a user defined signal.

Default behavior: process termination.

Source

pub fn user_defined_2(self) -> Self

The SIGUSR2 signal; a user defined signal.

Default behavior: process termination.

Source

pub fn window_change(self) -> Self

The SIGWINCH signal; sent when the terminal window is resized.

Default behavior: ignored.

Source

pub fn with(self, signal: SignalKind) -> Self

Returns self with signal added to it.

Source

pub fn insert(&mut self, signal: SignalKind)

Adds signal to self.

Trait Implementations§

Source§

impl Clone for SignalSetBuilder

Source§

fn clone(&self) -> SignalSetBuilder

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 Default for SignalSetBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Extend<SignalKind> for SignalSetBuilder

Source§

fn extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = SignalKind>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl FromIterator<SignalKind> for SignalSetBuilder

Source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = SignalKind>,

Creates a value from an iterator. Read more
Source§

impl Copy for SignalSetBuilder

Auto Trait Implementations§

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.