windows-result
The windows-result crate provides Windows error types for Win32, COM, and WinRT APIs.
Start by adding the following to your Cargo.toml file:
[]
= "0.100"
Use the HRESULT, Error, and specialized Result types as needed:
use *;
const S_OK: HRESULT = HRESULT;
const ERROR_CANCELLED: WIN32_ERROR = WIN32_ERROR;
const E_CANCELLED: HRESULT = ERROR_CANCELLED.to_hresult;