Simple async executor for windows application using windows crate.
``` Rust // 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 showinstalleddesktop_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) = windowsasync::blockon(showinstalleddesktop_app()) { println!("error: {:?}", e); } } ```