Debian Codegraph @

third_party/rust/diplomat/src/snapshots/diplomat__tests__mod_with_rust_result.snap

raw
1 ---
2 source: macro/src/lib.rs
3 expression: "rustfmt_code(&gen_bridge(parse_quote! {\n mod ffi\n {\n struct Foo {} impl Foo\n {\n pub fn bar(& self) -> Result < (), () >\n { unimplemented! () }\n }\n }\n }).to_token_stream().to_string())"
4 ---
5 mod ffi {
6 #[repr(C)]
7 #[derive(Clone, Copy)]
8 struct Foo {}
9 impl Foo {
10 pub fn bar(&self) -> Result<(), ()> {
11 unimplemented!()
12 }
13 }
14 use diplomat_runtime::*;
15 #[no_mangle]
16 extern "C" fn Foo_bar(this: &Foo) -> diplomat_runtime::DiplomatResult<(), ()> {
17 this.bar().into()
18 }
19 #[no_mangle]
20 extern "C" fn Foo_destroy(this: Box<Foo>) {}
21 }
22