windows-implement (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-implement@0.100.0+paring.1 --registry forgejoAbout this package
The implement macro for the Windows crates
windows-implement
The windows-implement crate provides the
#[implement] macro for implementing COM and WinRT interfaces in Rust.
Start by adding the following to your Cargo.toml file:
[dependencies]
windows-core = "0.100"
windows-implement = "0.100"
use windows_core::{IUnknown, interface};
use windows_implement::implement;
#[interface("57f61c8b-b400-4035-a7c2-abbddf9e3559")]
unsafe trait IValue: IUnknown {
fn get(&self) -> u32;
}
#[implement(IValue)]
struct Value(u32);
impl IValue_Impl for Value_Impl {
unsafe fn get(&self) -> u32 {
self.0
}
}
let value: IValue = Value(42).into();
assert_eq!(unsafe { value.get() }, 42);
Dependencies
| ID | Version |
|---|---|
| proc-macro2 | ^1.0 |
| quote | ^1.0 |
| syn | ^2.0 |
Details
2026-10-14 03:21:29 +09:00
2026-11-10 00:22:51 +09:00
Assets (1)
Versions (1)
View all
Cargo
20
MIT OR Apache-2.0
15 KiB
0.100.0+paring.1
2026-10-14