[−][src]Struct signal_hook::iterator::backend::SignalIterator
An infinite iterator of received signals.
Implementations
impl<R, E: Exfiltrator> SignalIterator<R, E> where
R: 'static + AsRawFd + Send + Sync,
[src]
R: 'static + AsRawFd + Send + Sync,
pub fn new(signals: SignalDelivery<R, E>) -> Self
[src]
Create a new infinite iterator for signals registered with the passed
in SignalDelivery
instance.
pub fn poll_signal<F>(&mut self, has_signals: &mut F) -> PollResult<E::Output> where
F: FnMut(&mut R) -> Result<bool, Error>,
[src]
F: FnMut(&mut R) -> Result<bool, Error>,
Return a signal if there is one or tell the caller that there is none at the moment.
You have to pass in a callback which checks the underlying reading end of the pipe if
there may be any pending signals. This callback may or may not block. If the callback
returns true
this method will try to fetch the next signal and return it as a
PollResult::Signal
. If the callback returns false
the method will return
PollResult::Pending
and assume it will be called again at a later point in time.
The callback may be called any number of times by this function.
If the iterator was closed by the close
method of the associtated
Handle
this method will return PollResult::Closed
.
pub fn handle(&self) -> Handle
[src]
Get a shareable Handle
for this instance.
This can be used to add further signals or terminate the whole
signal iteration using the close
method.
pub fn into_inner(self) -> SignalDelivery<R, E>
[src]
Consume this iterator and return the inner
SignalDelivery
instance.
Auto Trait Implementations
impl<R, E> !RefUnwindSafe for SignalIterator<R, E>
impl<R, E> Send for SignalIterator<R, E> where
R: Send,
<E as Exfiltrator>::Storage: Send + Sync,
R: Send,
<E as Exfiltrator>::Storage: Send + Sync,
impl<R, E> Sync for SignalIterator<R, E> where
R: Sync,
<E as Exfiltrator>::Storage: Send + Sync,
R: Sync,
<E as Exfiltrator>::Storage: Send + Sync,
impl<R, E> Unpin for SignalIterator<R, E> where
R: Unpin,
R: Unpin,
impl<R, E> !UnwindSafe for SignalIterator<R, E>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,