Crate com_shim

Source
Expand description

§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.

Macros§

com_shim
Generate a COM-compatible class structure.

Structs§

GUID
A globally unique identifier (GUID) used to identify COM and WinRT interfaces.
IDispatch
VARIANT
Required features: "Win32_Foundation", "Win32_System_Com", "Win32_System_Ole"

Traits§

HasIDispatch
A component that has an IDispatch value. Every component needs this, and this trait guarantees that.
IDispatchExt
Additional functions for working with an IDispatch.
IsA
Indicates that this type is also a parent type and can be upcast to it.
VariantExt
Extension functions for a VARIANT.
VariantTypeExt
Functions to convert to and from a type that can be stored in a VARIANT.

Type Aliases§

Result
A specialized Result type that provides Windows error information.