send_ctrlc 0.5.0

A cross platform crate for sending ctrl-c to child processes
Documentation
# send_ctrlc

[![Crate](https://img.shields.io/crates/v/send_ctrlc)](https://crates.io/crates/send_ctrlc)
[![Docs](https://docs.rs/send_ctrlc/badge.svg)](https://docs.rs/send_ctrlc)
[![Build](https://github.com/nu11ptr/send_ctrlc/workflows/CI/badge.svg)](https://github.com/nu11ptr/send_ctrlc/actions)
[![codecov](https://codecov.io/github/nu11ptr/send_ctrlc/graph/badge.svg?token=3M5tvBewE5)](https://codecov.io/github/nu11ptr/send_ctrlc)

A cross platform crate for sending ctrl-c to child processes

## Install

```shell
cargo add send_ctrlc
# Or for async/tokio:
cargo add send_ctrlc -F tokio
```

## Features

* Cross platform (including Windows)
* Uniform cross platform API
* Both sync and async
* Only 2 unsafe calls
* Minimal dependencies: 
    * Synchronous: `libc` on unix, and `windows-sys` on windows
    * Asynchronous: `tokio` (with only `process` feature)

## Examples

```rust
use send_ctrlc::{Interruptible as _, InterruptibleCommand as _};

// Synchronous...

#[cfg(not(feature = "tokio"))]
fn main() {
        // Create a continuous ping standard command
        let mut command = std::process::Command::new("ping");
        #[cfg(windows)]
        command.arg("-t");
        command.arg("127.0.0.1");

        // Spawn the ping, interrupt it, and wait for it to complete
        let mut child = command.spawn_interruptible().unwrap();
        child.interrupt().unwrap();
        child.wait().unwrap();
}

// or asynchronous...

#[cfg(feature = "tokio")]
#[tokio::main]
async fn main() {
        // Create a continuous ping standard command
        let mut command = tokio::process::Command::new("ping");
        #[cfg(windows)]
        command.arg("-t");
        command.arg("127.0.0.1");

        // Spawn the ping, interrupt it, and wait for it to complete
        let mut child = command.spawn_interruptible().unwrap();
        child.interrupt().unwrap();
        child.wait().await.unwrap();
}
```

## Contributions

Contributions are welcome as long they align with the vision for this crate.