3 unstable releases
new 0.1.1 | Feb 21, 2025 |
---|---|
0.1.0 | Feb 21, 2025 |
0.0.0 | Feb 10, 2025 |
#26 in #type
116 downloads per month
Used in 23 crates
(via windows)
250KB
6K
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.1"
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
~265–700KB
~17K SLoC