pub struct Signals { /* private fields */ }
Available on Linux only.
Expand description
An event source for receiving Unix signals
Implementations
sourceimpl Signals
impl Signals
sourcepub fn new(signals: &[Signal]) -> Result<Signals>
pub fn new(signals: &[Signal]) -> Result<Signals>
Create a new signal event source listening on the specified list of signals
sourcepub fn add_signals(&mut self, signals: &[Signal]) -> Result<()>
pub fn add_signals(&mut self, signals: &[Signal]) -> Result<()>
Add a list of signals to the signals source
If this function returns an error, the signal mask of the thread may have still been changed.
Trait Implementations
sourceimpl EventSource for Signals
impl EventSource for Signals
type Error = SignalError
type Error = SignalError
The error type returned from
process_events()
(not the user callback!). Read more
sourcefn process_events<C>(
&mut self,
readiness: Readiness,
token: Token,
callback: C
) -> Result<PostAction, Self::Error> where
C: FnMut(Self::Event, &mut Self::Metadata) -> Self::Ret,
fn process_events<C>(
&mut self,
readiness: Readiness,
token: Token,
callback: C
) -> Result<PostAction, Self::Error> where
C: FnMut(Self::Event, &mut Self::Metadata) -> Self::Ret,
Process any relevant events Read more
sourcefn register(
&mut self,
poll: &mut Poll,
token_factory: &mut TokenFactory
) -> Result<()>
fn register(
&mut self,
poll: &mut Poll,
token_factory: &mut TokenFactory
) -> Result<()>
Register yourself to this poll instance Read more
sourcefn reregister(
&mut self,
poll: &mut Poll,
token_factory: &mut TokenFactory
) -> Result<()>
fn reregister(
&mut self,
poll: &mut Poll,
token_factory: &mut TokenFactory
) -> Result<()>
Re-register your file descriptors Read more
sourcefn unregister(&mut self, poll: &mut Poll) -> Result<()>
fn unregister(&mut self, poll: &mut Poll) -> Result<()>
Unregister your file descriptors Read more
Auto Trait Implementations
impl !RefUnwindSafe for Signals
impl Send for Signals
impl Sync for Signals
impl Unpin for Signals
impl !UnwindSafe for Signals
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more