https://github.com/dmarcuse/manual_future
Manually completable futures for Rust, similar to Java's CompletableFuture
https://github.com/dmarcuse/manual_future
async future rust
Last synced: 3 months ago
JSON representation
Manually completable futures for Rust, similar to Java's CompletableFuture
- Host: GitHub
- URL: https://github.com/dmarcuse/manual_future
- Owner: dmarcuse
- License: mit
- Created: 2019-11-23T22:23:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-07-20T17:14:49.000Z (11 months ago)
- Last Synced: 2026-01-02T08:13:45.343Z (6 months ago)
- Topics: async, future, rust
- Language: Rust
- Size: 9.77 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# manual_future
Explicitly completed `Future` type for Rust, similar to Java's `CompletableFuture`
## Example
```rust
// 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);
```