Crates.io | windows-future |
lib.rs | windows-future |
version | |
source | src |
created_at | 2025-02-10 20:05:42.906954+00 |
updated_at | 2025-03-18 19:10:36.958321+00 |
description | Windows async types |
homepage | |
repository | https://github.com/microsoft/windows-rs |
max_upload_size | |
id | 1550627 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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(())
}