extern crate intercom; use intercom::{ComItf, ComRc, ComResult}; #[intercom::com_interface] pub trait MyInterface { fn interface_method(&self) {} } #[intercom::com_class(MyStruct, MyInterface)] pub struct MyStruct; impl MyInterface for MyStruct { fn interface_method(&self) {} } #[intercom::com_interface] impl MyStruct { fn struct_method(&self) {} } pub fn from_trait_itf(itf: &ComItf) { let _: ComRc = ComRc::from(itf); let _: ComRc = itf.to_owned(); let _: ComResult> = ComItf::query_interface(itf); } pub fn from_struct_itf(itf: &ComItf) { let _: ComRc = ComRc::from(itf); let _: ComRc = itf.to_owned(); let _: ComResult> = ComItf::query_interface(itf); } pub fn from_struct(s1: intercom::ComBox, s2: intercom::ComBox) { let _: ComRc = ComRc::from(s1); let _: ComRc = ComRc::from(s2); } pub fn from_struct_ref(s: &intercom::ComBox) { let _: ComRc = ComRc::from(s); let _: ComRc = ComRc::from(s); } pub fn pass_comrc(rc: ComRc) { from_trait_itf(&rc); }