| 1 |
/*! |
| 2 |
Learn more about Rust for Windows here: <https://github.com/microsoft/windows-rs> |
| 3 |
*/ |
| 4 |
|
| 5 |
#![doc(html_no_source)] |
| 6 |
#![allow(non_snake_case)] |
| 7 |
#![cfg_attr(windows_debugger_visualizer, debugger_visualizer(natvis_file = "../windows.natvis"))] |
| 8 |
|
| 9 |
extern crate self as windows_core; |
| 10 |
|
| 11 |
#[doc(hidden)] |
| 12 |
pub mod imp; |
| 13 |
|
| 14 |
mod agile_reference; |
| 15 |
mod array; |
| 16 |
mod as_impl; |
| 17 |
mod com_interface; |
| 18 |
mod error; |
| 19 |
mod event; |
| 20 |
mod guid; |
| 21 |
mod hresult; |
| 22 |
mod inspectable; |
| 23 |
mod interface; |
| 24 |
mod param; |
| 25 |
mod runtime_name; |
| 26 |
mod runtime_type; |
| 27 |
mod scoped_interface; |
| 28 |
mod strings; |
| 29 |
mod r#type; |
| 30 |
mod unknown; |
| 31 |
mod weak; |
| 32 |
|
| 33 |
pub use agile_reference::*; |
| 34 |
pub use array::*; |
| 35 |
pub use as_impl::*; |
| 36 |
pub use com_interface::*; |
| 37 |
pub use error::*; |
| 38 |
pub use event::*; |
| 39 |
pub use guid::*; |
| 40 |
pub use hresult::*; |
| 41 |
pub use inspectable::*; |
| 42 |
pub use interface::*; |
| 43 |
pub use param::*; |
| 44 |
pub use r#type::*; |
| 45 |
pub use runtime_name::*; |
| 46 |
pub use runtime_type::*; |
| 47 |
pub use scoped_interface::*; |
| 48 |
pub use strings::*; |
| 49 |
pub use unknown::*; |
| 50 |
pub use weak::*; |
| 51 |
|
| 52 |
/// A specialized [`Result`] type that provides Windows error information. |
| 53 |
pub type Result<T> = std::result::Result<T, Error>; |
| 54 |
|
| 55 |
/// Attempts to load the factory object for the given WinRT class. |
| 56 |
/// This can be used to access COM interfaces implemented on a Windows Runtime class factory. |
| 57 |
pub fn factory<C: RuntimeName, I: ComInterface>() -> Result<I> { |
| 58 |
crate::imp::factory::<C, I>() |
| 59 |
} |