extern crate intercom; use intercom::*; use std::mem::MaybeUninit; // We need the IID and Vtbl to ensure this compiles. // // Normally these are provided by the [com_interface]. #[allow(non_camel_case_types)] struct __Foo_AutomationVtbl; const IID_Foo_Automation: intercom::IID = intercom::GUID { data1: 0, data2: 0, data3: 0, data4: [0, 0, 0, 0, 0, 0, 0, 0], }; #[allow(non_camel_case_types)] struct __Foo_RawVtbl; const IID_Foo_Raw: intercom::IID = intercom::GUID { data1: 0, data2: 0, data3: 0, data4: [0, 0, 0, 0, 0, 0, 0, 0], }; fn get_intercom_interface_info_for_Foo() -> Vec { unsafe { MaybeUninit::uninit().assume_init() } } #[com_class(clsid = "{00000000-0000-0000-0000-000000000000}", Foo)] pub struct Foo; impl Foo { fn static_method(a: u16, b: i16) {} fn simple_method(&self) {} fn arg_method(&self, a: u16) {} fn simple_result_method(&self) -> u16 { 0 } fn com_result_method(&self) -> ComResult { Ok(0) } fn rust_result_method(&self) -> Result { Ok(0) } fn tuple_result_method(&self) -> Result<(u8, u16, u32), i32> { Ok(0) } fn string_method(&self, input: String) -> String { input } fn string_result_method(&self, input: String) -> ComResult { Ok(input) } fn complete_method(&mut self, a: u16, b: i16) -> ComResult { Ok(true) } // Should be VARIANT_BOOL in Automation interface. fn bool_method(&self, input: bool) -> ComResult { Ok(input) } fn variant_method(&self, input: Variant) -> ComResult { Ok(input) } }