1 use super::Ctx;
2 use crate::util::yield_times;
3 use wasmtime::Result;
4 use wasmtime::component::Accessor;
5 
6 pub mod bindings {
7     wasmtime::component::bindgen!({
8         path: "wit",
9         world: "round-trip-many",
10         additional_derives: [ Eq, PartialEq ],
11     });
12 }
13 
14 pub mod non_concurrent_export_bindings {
15     wasmtime::component::bindgen!({
16         path: "wit",
17         world: "round-trip-many",
18         additional_derives: [ Eq, PartialEq ],
19         exports: { default: ignore_wit | async },
20     });
21 }
22 
23 use bindings::local::local::many::Stuff;
24 
25 impl bindings::local::local::many::HostWithStore for Ctx {
foo<T>( _: &Accessor<T, Self>, a: String, b: u32, c: Vec<u8>, d: (u64, u64), e: Stuff, f: Option<Stuff>, g: Result<Stuff, ()>, ) -> ( String, u32, Vec<u8>, (u64, u64), Stuff, Option<Stuff>, Result<Stuff, ()>, )26     async fn foo<T>(
27         _: &Accessor<T, Self>,
28         a: String,
29         b: u32,
30         c: Vec<u8>,
31         d: (u64, u64),
32         e: Stuff,
33         f: Option<Stuff>,
34         g: Result<Stuff, ()>,
35     ) -> (
36         String,
37         u32,
38         Vec<u8>,
39         (u64, u64),
40         Stuff,
41         Option<Stuff>,
42         Result<Stuff, ()>,
43     ) {
44         yield_times(5).await;
45         (
46             format!("{a} - entered host - exited host"),
47             b,
48             c,
49             d,
50             e,
51             f,
52             g,
53         )
54     }
55 }
56 
57 impl bindings::local::local::many::Host for Ctx {}
58