12 releases

0.3.6 Sep 26, 2023
0.3.5 Aug 31, 2023
0.2.2 Aug 11, 2023
0.1.2 Aug 11, 2023

#5 in #i64

Download history 32/week @ 2024-02-25 6/week @ 2024-03-03 22/week @ 2024-03-10 8/week @ 2024-03-17 1/week @ 2024-03-24 68/week @ 2024-03-31

100 downloads per month
Used in sap-scripting

MIT license

18KB
424 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! {
    class GuiComponent {
        Text: String,
    }
}

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

com_shim! {
    class 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

~153MB
~2.5M SLoC