Windows error handling
The windows-result crate provides efficient Windows error handling and propagation with support for Win32, COM, and WinRT APIs.
Start by adding the following to your Cargo.toml file:
[]
= "0.3"
Use the HRESULT, Error, and specialized Result types as needed:
use *;
const S_OK: HRESULT = HRESULT;
const ERROR_CANCELLED: u32 = 1223;
const E_CANCELLED: HRESULT = HRESULTfrom_win32;