Struct signal_hook_mio::v1_0::SignalsInfo
source · pub struct SignalsInfo<E: Exfiltrator = SignalOnly>(/* private fields */);
Expand description
A struct which mimics signal_hook::iterator::SignalsInfo
but also allows usage together with MIO runtime.
Implementations§
source§impl<E: Exfiltrator> SignalsInfo<E>
impl<E: Exfiltrator> SignalsInfo<E>
sourcepub fn new<I, S>(signals: I) -> Result<Self, Error>where
I: IntoIterator<Item = S>,
S: Borrow<c_int>,
E: Default,
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
.
sourcepub fn with_exfiltrator<I, S>(signals: I, exfiltrator: E) -> Result<Self, Error>where
I: IntoIterator<Item = S>,
S: Borrow<c_int>,
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.
sourcepub fn add_signal(&self, signal: c_int) -> Result<(), Error>
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
.
sourcepub fn pending(&mut self) -> Pending<E> ⓘ
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.