windows-async 0.1.0

Simple async executor for windows application using windows crate.
docs.rs failed to build windows-async-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: windows-async-0.2.1

windows-async-rs

Simple async executor for windows application using windows crate.

Example

// Show Desktop App list example (using WinRT "Windows.Inventory.InstalledDesktopApp")
use windows_async::{IntoAwaiter};

use windows::core::{
    Result,
};

use windows::System::Inventory::{
    InstalledDesktopApp,
};

async fn show_installed_desktop_app() -> Result<()> {

    // `IAsyncOperation` converts to `AsyncOperationAwaiter` and then awaits.
    // (`IntoAwaiter::into_awaiter()` method is convenient.)
    let vec = InstalledDesktopApp::GetInventoryAsync()?.into_awaiter().await?;

    for i in 0..vec.Size()? {
        let item = vec.GetAt(i)?;
        println!("Id: {:?}", item.Id()?);
        println!("DisplayName: {:?}", item.DisplayName()?);
        println!("Publisher: {:?}", item.Publisher()?);
        println!("DisplayVersion: {:?}", item.DisplayVersion()?);
        println!();
    }

    Ok(())
}

fn main() {
    if let Err(e) = windows_async::block_on(show_installed_desktop_app()) {
        println!("error: {:?}", e);
    }
}