future_handles

Crates.iofuture_handles
lib.rsfuture_handles
version0.2.0
sourcesrc
created_at2022-02-05 23:06:30.011861
updated_at2022-02-06 17:25:46.857984
descriptionA library crate to complete futures via handles
homepage
repositoryhttps://codeberg.org/Mek101/future_handles
max_upload_size
id527616
size33,778
Mek (Mek101)

documentation

README

Future Handles

A rust library to complete futures via a remote handle.

async fn func() -> Option<u32> {
     let (future, handle) = unsync::create();

     func_with_callback(|| {
         handle.complete(1);
     });

     match future.await {
         // The callback was invoked and the result set via the handle.
         Ok(res) => Some(res),
         // The callback was never invoked, but the handle has been dropped.
         Err(_) => None
     }
}
Commit count: 0

cargo fmt