manual_future

Crates.iomanual_future
lib.rsmanual_future
version0.1.4
created_at2019-11-23 22:36:54.029527+00
updated_at2026-01-02 23:09:23.256517+00
descriptionA future that must be manually completed, similar to Java's CompletableFuture
homepagehttps://github.com/dmarcuse/manual_future
repositoryhttps://github.com/dmarcuse/manual_future.git
max_upload_size
id183825
size12,076
Dana Marcuse (dmarcuse)

documentation

README

manual_future

Explicitly completed Future type for Rust, similar to Java's CompletableFuture

Example

// 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);
Commit count: 0

cargo fmt