~jpastuszek/uninterruptible

Guard type that keeps selected Unix signals suppressed

4d79dc5 docs, LICENSE and cargo meta

25 days ago

cbba8ad (cargo-release) start next development iteration 0.1.0

25 days ago

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.