Struct signal::trap::Trap[][src]

pub struct Trap { /* fields omitted */ }

A RAII guard for masking out signals and waiting for them synchronously

Trap temporarily replaces signal handlers to an empty handler, effectively activating singnals that are ignored by default.

Old signal handlers are restored in Drop handler.

Implementations

impl Trap[src]

pub fn trap(signals: &[Signal]) -> Trap

Notable traits for Trap

impl Iterator for Trap type Item = Signal;
[src]

Create and activate the signal trap for specified signals. Signals not in list will be delivered asynchronously as always.

pub fn wait(&self, deadline: Instant) -> Option<Signal>[src]

Wait until any of signals arrived or timeout occurs. In case of timeout returns None, otherwise returns signal number.

Note the argument here is a deadline, not timeout. It’s easier to work with deadline if you call wait() function in a loop.

Trait Implementations

impl Debug for Trap[src]

impl Drop for Trap[src]

impl Iterator for Trap[src]

type Item = Signal

The type of the elements being iterated over.

Auto Trait Implementations

impl RefUnwindSafe for Trap

impl Send for Trap

impl Sync for Trap

impl Unpin for Trap

impl UnwindSafe for Trap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.