1/*!
2Learn 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
9extern crate self as windows_core;
10
11#[doc(hidden)]
12pub mod imp;
13
14mod agile_reference;
15mod array;
16mod as_impl;
17mod com_interface;
18mod error;
19mod event;
20mod guid;
21mod hresult;
22mod inspectable;
23mod interface;
24mod param;
25mod runtime_name;
26mod runtime_type;
27mod scoped_interface;
28mod strings;
29mod r#type;
30mod unknown;
31mod weak;
32
33pub use agile_reference::*;
34pub use array::*;
35pub use as_impl::*;
36pub use com_interface::*;
37pub use error::*;
38pub use event::*;
39pub use guid::*;
40pub use hresult::*;
41pub use inspectable::*;
42pub use interface::*;
43pub use param::*;
44pub use r#type::*;
45pub use runtime_name::*;
46pub use runtime_type::*;
47pub use scoped_interface::*;
48pub use strings::*;
49pub use unknown::*;
50pub use weak::*;
51
52/// A specialized [`Result`] type that provides Windows error information.
53pub 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.
57pub fn factory<C: RuntimeName, I: ComInterface>() -> Result<I> {
58 crate::imp::factory::<C, I>()
59}
60