4 releases (2 breaking)

new 0.2.0 Mar 18, 2025
0.1.2 Mar 18, 2025
0.1.1 Feb 21, 2025
0.1.0 Feb 21, 2025
0.0.0 Feb 10, 2025

#376 in Windows APIs

Download history 103/week @ 2025-02-09 1166/week @ 2025-02-16 17793/week @ 2025-02-23 48065/week @ 2025-03-02 69031/week @ 2025-03-09 64759/week @ 2025-03-16

200,436 downloads per month
Used in 370 crates (via windows)

MIT/Apache

290KB
7K SLoC

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.2"

Use the Windows async types as needed:

use windows_future::*;
use windows_result::*;

fn main() -> Result<()> {
    // This result will be available immediately.
    let ready = IAsyncOperation::ready(Ok(123));
    assert_eq!(ready.get()?, 123);

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

    assert_eq!(ready.get()?, 456);

    Ok(())
}

Dependencies

~240–680KB
~16K SLoC