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 enum Abc { A, B = 123, } impl Abc\n { pub fn do_something(& self) { unimplemented! () } }\n }\n }).to_token_stream().to_string())"
---
mod ffi {
#[repr(C)]
#[derive(Clone, Copy)]
enum Abc {
A,
B = 123,
}
impl Abc {
pub fn do_something(&self) {
unimplemented!()
}
}
use diplomat_runtime::*;
#[no_mangle]
extern "C" fn Abc_do_something(this: &Abc) {
this.do_something()
}
#[no_mangle]
extern "C" fn Abc_destroy(this: Box<Abc>) {}
}