Skip to main content

windows_result/
lib.rs

1#![doc = include_str!("../readme.md")]
2#![debugger_visualizer(natvis_file = "../windows-result.natvis")]
3#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
4#![cfg_attr(not(windows), expect(unused_imports))]
5#![expect(
6    non_upper_case_globals,
7    non_snake_case,
8    non_camel_case_types,
9    clippy::upper_case_acronyms
10)]
11
12extern crate alloc;
13
14use alloc::{string::String, vec::Vec};
15
16#[expect(
17    dead_code,
18    reason = "IErrorInfo's generated IID accompanies the vtable but is not needed"
19)]
20mod bindings;
21use bindings::*;
22
23#[cfg(all(windows, not(windows_slim_errors)))]
24mod com;
25
26#[cfg(windows)]
27mod strings;
28#[cfg(windows)]
29use strings::*;
30
31#[cfg(all(windows, not(windows_slim_errors)))]
32mod bstr;
33
34mod error;
35pub use error::*;
36
37mod hresult;
38pub use hresult::HRESULT;
39
40mod bool;
41pub use bool::BOOL;
42
43mod win32_error;
44pub use win32_error::WIN32_ERROR;
45
46mod ntstatus;
47pub use ntstatus::NTSTATUS;
48
49mod rpc_status;
50pub use rpc_status::RPC_STATUS;
51
52/// A specialized [`Result`] type that provides Windows error information.
53pub type Result<T> = core::result::Result<T, Error>;