Type Alias signal_hook_mio::v1_0::Signals

source ·
pub type Signals = SignalsInfo<SignalOnly>;
Expand description

A simplified signal iterator.

This is the SignalsInfo, but returning only the signal numbers. This is likely the one you want to use.

Aliased Type§

struct Signals(/* private fields */);

Implementations§

source§

impl<E: Exfiltrator> SignalsInfo<E>

source

pub fn new<I, S>(signals: I) -> Result<Self, Error>where I: IntoIterator<Item = S>, S: Borrow<c_int>, E: Default,

Create a Signals instance.

This registers all the signals listed. The same restrictions (panics, errors) apply as with Handle::add_signal.

source

pub fn with_exfiltrator<I, S>(signals: I, exfiltrator: E) -> Result<Self, Error>where I: IntoIterator<Item = S>, S: Borrow<c_int>,

A constructor with specifying an exfiltrator to pass information out of the signal handlers.

source

pub fn add_signal(&self, signal: c_int) -> Result<(), Error>

Registers another signal to the set watched by this Signals instance.

The same restrictions (panics, errors) apply as with Handle::add_signal.

source

pub fn pending(&mut self) -> Pending<E>

Returns an iterator of already received signals.

This returns an iterator over all the signal numbers of the signals received since last time they were read (out of the set registered by this Signals instance). Note that they are returned in arbitrary order and a signal number is returned only once even if it was received multiple times.

This method returns immediately (does not block) and may produce an empty iterator if there are no signals ready. So you should register an instance of this struct at an instance of mio::Poll to query for readability of the underlying self pipe.

Trait Implementations§

source§

impl Source for Signals

source§

fn register( &mut self, registry: &Registry, token: Token, interest: Interest ) -> Result<(), Error>

Register self with the given Registry instance. Read more
source§

fn reregister( &mut self, registry: &Registry, token: Token, interest: Interest ) -> Result<(), Error>

Re-register self with the given Registry instance. Read more
source§

fn deregister(&mut self, registry: &Registry) -> Result<(), Error>

Deregister self from the given Registry instance. Read more