makepad/libs/windows/windows-future
2026-02-16 09:10:27 +01:00
..
src windowsrs vendored 2026-02-14 12:27:38 +01:00
Cargo.toml windowsrs vendored 2026-02-14 12:27:38 +01:00
license-apache-2.0 windowsrs vendored 2026-02-14 12:27:38 +01:00
license-mit windowsrs vendored 2026-02-14 12:27:38 +01:00
readme.md windowsrs vendored 2026-02-14 12:27:38 +01:00

Windows async types

The windows-future crate provides stock async support for Windows APIs.

Start by adding the following to your Cargo.toml file:

[dependencies.windows-future]
version = "0.3"

Use the Windows async types as needed:

use windows_future::*;

// This result will be available immediately.
let ready = IAsyncOperation::ready(Ok(123));
assert_eq!(ready.join().unwrap(), 123);

let ready = IAsyncOperation::spawn(|| {
    // Some lengthy operation goes here...
    Ok(456)
});

assert_eq!(ready.join().unwrap(), 456);