1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Simple async executor for windows application using
//! [windows](https://github.com/microsoft/windows-rs) crate.
//! 
//! # Examples
//! ```
//! // 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);
//!     }
//! }
//! ```
//! 

mod awaiter;
mod executor;

pub use awaiter::{
    IntoAwaiter,
    AsyncOperationAwaiter,
    AsyncActionAwaiter,
};

pub use executor::{
    block_on,
    create_dummy_window,
    DummyWindow,
};