| Crates.io | terminal-wait-exit |
| lib.rs | terminal-wait-exit |
| version | 1.0.1 |
| created_at | 2024-06-13 10:46:49.855908+00 |
| updated_at | 2025-09-28 01:53:47.447337+00 |
| description | wait user exit terminal, like Ctrl+C |
| homepage | |
| repository | https://github.com/chen3cn/terminal-wait-exit |
| max_upload_size | |
| id | 1270536 |
| size | 10,135 |
wait user exit terminal, like Ctrl+C.
cargo.toml
terminal-wait-exit = "1.0"
#[tokio::main]
async fn main() {
// Spawn the server into a runtime
tokio::spawn(async move {
// work
server.serve(service).await;
});
if let Err(e) = terminal-wait-exit::wait_exit().await {
error!("Listening exit failed.{:?}", e);
}
stop_graceful();
}