4 releases (2 breaking)

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

#360 in Windows APIs

Download history 100/week @ 2025-02-08 381/week @ 2025-02-15 14360/week @ 2025-02-22 47722/week @ 2025-03-01 67314/week @ 2025-03-08 70706/week @ 2025-03-15 71280/week @ 2025-03-22 67730/week @ 2025-03-29 98754/week @ 2025-04-05 92759/week @ 2025-04-12

339,764 downloads per month
Used in 615 crates (3 directly)

MIT/Apache

280KB
6.5K 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

~225–660KB
~16K SLoC