Skip to content

Manually completable futures for Rust, similar to Java's CompletableFuture

License

Notifications You must be signed in to change notification settings

dmarcuse/manual_future

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Manually completable futures for Rust, similar to Java's CompletableFuture

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages