16 releases

Uses new Rust 2024

0.4.3 Mar 28, 2025
0.4.2 Mar 28, 2025
0.3.6 Sep 26, 2023
0.3.5 Aug 31, 2023
0.1.2 Aug 11, 2023

#97 in Windows APIs

Download history 4/week @ 2024-12-18 5/week @ 2025-01-08 8/week @ 2025-01-15 6/week @ 2025-01-22 13/week @ 2025-02-05 7/week @ 2025-02-12 11/week @ 2025-02-26 20/week @ 2025-03-12 2/week @ 2025-03-19 554/week @ 2025-03-26 24/week @ 2025-04-02

600 downloads per month
Used in sap-scripting

MIT license

18KB
418 lines

COM Shim

Easily write interfaces that can read from COM, without worrying about the underlying functionality (unless you want to!).

Example

use com_shim::com_shim;

com_shim! {
    struct GuiComponent {
        Text: String,
    }
}

com_shim! {
    struct GuiVComponent {
        fn SetFocus(),
    }
}

com_shim! {
    struct GuiTextField: GuiVComponent + GuiComponent {
        CaretPosition: i64,
        DisplayedText: String,
        mut Highlighted: bool,

        fn GetListProperty(String) -> GuiComponent,
    }
}

fn main() {
    // The following call now would trigger a COM call:
    // let a: GuiTextField;
    // a.get_list_property("property");
}

You can also see it implemented in the sap-scripting package.

Dependencies

~119MB
~2M SLoC