windows-result (0.100.0+paring.1)
Published 2026-10-14 03:21:29 +09:00 by paring
Installation
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add windows-result@0.100.0+paring.1 --registry forgejoAbout this package
Windows error handling
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:
[dependencies.windows-result]
version = "0.100"
Use the HRESULT, Error, and specialized Result types as needed:
use windows_result::*;
const S_OK: HRESULT = HRESULT(0);
const ERROR_CANCELLED: WIN32_ERROR = WIN32_ERROR(1223);
const E_CANCELLED: HRESULT = ERROR_CANCELLED.to_hresult();
fn main() -> Result<()> {
S_OK.ok()?;
let e = Error::new(E_CANCELLED, "test message");
assert_eq!(e.code(), E_CANCELLED);
assert_eq!(e.message(), "test message");
Ok(())
}
Dependencies
| ID | Version |
|---|---|
| windows-link | ^0.100.0 |
Details
2026-10-14 03:21:29 +09:00
2026-11-15 19:56:42 +09:00
Assets (1)
Versions (1)
View all
Cargo
21
MIT OR Apache-2.0
13 KiB
0.100.0+paring.1
2026-10-14