com-shim

Crates.iocom-shim
lib.rscom-shim
version0.4.3
created_at2023-08-11 15:19:05.689658+00
updated_at2025-03-28 11:23:07.0535+00
descriptionCreate safe Rusty shims for COM classes.
homepage
repositoryhttps://github.com/lilopkins/com-shim-rs
max_upload_size
id942021
size23,172
Lily Hopkins (lilopkins)

documentation

README

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.

Commit count: 47

cargo fmt