Source code

Revision control

Copy as Markdown

Other Tools

---
source: macro/src/lib.rs
expression: "rustfmt_code(&gen_bridge(parse_quote! {\n mod ffi\n {\n struct Foo {} impl Foo\n {\n #[cfg(feature = \"foo\")] pub fn bar(s : u8)\n { unimplemented! () }\n }\n }\n }).to_token_stream().to_string())"
---
mod ffi {
#[repr(C)]
#[derive(Clone, Copy)]
struct Foo {}
impl Foo {
#[cfg(feature = "foo")]
pub fn bar(s: u8) {
unimplemented!()
}
}
use diplomat_runtime::*;
#[no_mangle]
#[cfg(feature = "foo")]
extern "C" fn Foo_bar(s: u8) {
Foo::bar(s)
}
#[no_mangle]
extern "C" fn Foo_destroy(this: Box<Foo>) {}
}