~jpastuszek/uninterruptible

Guard type that keeps selected Unix signals suppressed
(cargo-release) start next development iteration 0.1.0
docs, LICENSE and cargo meta

clone

read-only
https://git.sr.ht/~jpastuszek/uninterruptible
read/write
git@git.sr.ht:~jpastuszek/uninterruptible

You can also use your local clone with git send-email.

Latest Version Documentation License

Guard type that keeps selected Unix signals suppressed.

use uninterruptible::Uninterruptible;

// catch terminate signals (SIGTERM, SIGQUIT, SIGINT)
let u = Uninterruptible::terminate()?;

// do work, e.g. call in sub-process

u.checkpoint()?; // fails if the process recived one of the terminate signals (e.g. CTRL-C was pressed)


drop(u); // revert to default signal handlers

See module level documentation on docs.rs for more examples.