| Crates.io | manual_future |
| lib.rs | manual_future |
| version | 0.1.4 |
| created_at | 2019-11-23 22:36:54.029527+00 |
| updated_at | 2026-01-02 23:09:23.256517+00 |
| description | A future that must be manually completed, similar to Java's CompletableFuture |
| homepage | https://github.com/dmarcuse/manual_future |
| repository | https://github.com/dmarcuse/manual_future.git |
| max_upload_size | |
| id | 183825 |
| size | 12,076 |
Explicitly completed Future type for Rust, similar to Java's CompletableFuture
// create a new, incomplete ManualFuture
let (future, completer) = ManualFuture::new();
// complete the future with a value
completer.complete(5).await;
// retrieve the value from the future
assert_eq!(future.await, 5);
// you can also create ManualFuture instances that are already completed
assert_eq!(ManualFuture::new_completed(10).await, 10);