manual_future

Crates.iomanual_future
lib.rsmanual_future
version0.1.1
sourcesrc
created_at2019-11-23 22:36:54.029527
updated_at2019-11-27 18:21:33.069293
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
size8,573
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: 2

cargo fmt