pub struct Signals { /* private fields */ }
Expand description
An event source for receiving Unix signals
Implementations§
source§impl 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.
sourcepub fn remove_signals(&mut self, signals: &[Signal]) -> Result<()>
pub fn remove_signals(&mut self, signals: &[Signal]) -> Result<()>
Remove a list of signals from the signals source
If this function returns an error, the signal mask of the thread may have still been changed.
sourcepub fn set_signals(&mut self, signals: &[Signal]) -> Result<()>
pub fn set_signals(&mut self, signals: &[Signal]) -> Result<()>
Replace the list of signals of the source
If this function returns an error, the signal mask of the thread may have still been changed.
Trait Implementations§
source§impl EventSource for Signals
impl EventSource for Signals
§type Error = SignalError
type Error = SignalError
The error type returned from
process_events()
(not the user callback!).source§fn process_events<C>(
&mut self,
readiness: Readiness,
token: Token,
callback: C
) -> Result<PostAction, Self::Error>
fn process_events<C>( &mut self, readiness: Readiness, token: Token, callback: C ) -> Result<PostAction, Self::Error>
Process any relevant events Read more
source§fn 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
source§fn 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
source§fn 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more