Struct graceful::SignalGuard
[−]
[src]
pub struct SignalGuard(_);
Methods
impl SignalGuard
[src]
fn new() -> SignalGuard
Block necessary signals (SIGINT
, SIGQUIT
and SIGTERM
on *nix,
Ctrl+C
and Ctrl+Break
on Windows).
New threads should be spawned after this.
fn at_exit<F: FnOnce(usize)>(&self, handler: F)
Block the running thread until a signal is received. Then the
handler
will be called in the main thread.
Do not put any code after this.