• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2source: macro/src/lib.rs
3expression: "rustfmt_code(&gen_bridge(parse_quote! {\n                            mod ffi\n                            {\n                                struct Foo {} impl Foo\n                                {\n                                    pub fn to_string(&self, to: &mut DiplomatWrite) ->\n                                    Result<(), ()> { unimplemented!() }\n                                }\n                            }\n                        }).to_token_stream().to_string())"
4---
5mod ffi {
6    #[repr(C)]
7    struct Foo {}
8    impl Foo {
9        pub fn to_string(&self, to: &mut DiplomatWrite) -> Result<(), ()> {
10            unimplemented!()
11        }
12    }
13    use core::ffi::c_void;
14    use diplomat_runtime::*;
15    #[no_mangle]
16    extern "C" fn Foo_to_string(
17        this: &Foo,
18        to: &mut diplomat_runtime::DiplomatWrite,
19    ) -> diplomat_runtime::DiplomatResult<(), ()> {
20        let ret = this.to_string(to);
21        to.flush();
22        ret.into()
23    }
24}
25