| Crates.io | absurd-future |
| lib.rs | absurd-future |
| version | 0.2.0 |
| created_at | 2025-11-26 14:00:25.715668+00 |
| updated_at | 2025-11-26 14:06:37.013999+00 |
| description | A future adapter that turns a future that never resolves (returns Infallible) into a future that can resolve to any type. |
| homepage | |
| repository | https://github.com/fpco/absurd-future |
| max_upload_size | |
| id | 1951438 |
| size | 12,521 |
A future adapter that turns a future that never resolves (i.e., returns Infallible) into a future that can resolve to any type.
This is useful in scenarios where you have a task that runs forever (like a background service) but need to integrate it into an API that expects a specific return type, such as tokio::task::JoinSet.
For a detailed explanation of the motivation behind this crate and the concept of uninhabited types in Rust async code, see the blog post: How to use Rust's never type (!) to write cleaner async code.
For a complete, runnable example of how to use this crate with tokio::task::JoinSet, please see the example file: examples/tokio.rs.
This project is licensed under the MIT license.