1636435f1SJoel Dice /// Auto-generated bindings for a pre-instantiated version of a
2636435f1SJoel Dice /// component which implements the world `the-world`.
3636435f1SJoel Dice ///
4636435f1SJoel Dice /// This structure is created through [`TheWorldPre::new`] which
5636435f1SJoel Dice /// takes a [`InstancePre`](wasmtime::component::InstancePre) that
6636435f1SJoel Dice /// has been created through a [`Linker`](wasmtime::component::Linker).
7636435f1SJoel Dice ///
8636435f1SJoel Dice /// For more information see [`TheWorld`] as well.
9f81c0dc0SAlex Crichton pub struct TheWorldPre<T: 'static> {
10636435f1SJoel Dice     instance_pre: wasmtime::component::InstancePre<T>,
11636435f1SJoel Dice     indices: TheWorldIndices,
12636435f1SJoel Dice }
13f81c0dc0SAlex Crichton impl<T: 'static> Clone for TheWorldPre<T> {
14636435f1SJoel Dice     fn clone(&self) -> Self {
15636435f1SJoel Dice         Self {
16636435f1SJoel Dice             instance_pre: self.instance_pre.clone(),
17636435f1SJoel Dice             indices: self.indices.clone(),
18636435f1SJoel Dice         }
19636435f1SJoel Dice     }
20636435f1SJoel Dice }
21f81c0dc0SAlex Crichton impl<_T: 'static> TheWorldPre<_T> {
22636435f1SJoel Dice     /// Creates a new copy of `TheWorldPre` bindings which can then
23636435f1SJoel Dice     /// be used to instantiate into a particular store.
24636435f1SJoel Dice     ///
25636435f1SJoel Dice     /// This method may fail if the component behind `instance_pre`
26636435f1SJoel Dice     /// does not have the required exports.
27636435f1SJoel Dice     pub fn new(
28636435f1SJoel Dice         instance_pre: wasmtime::component::InstancePre<_T>,
29636435f1SJoel Dice     ) -> wasmtime::Result<Self> {
30bb77f602SPat Hickey         let indices = TheWorldIndices::new(&instance_pre)?;
31636435f1SJoel Dice         Ok(Self { instance_pre, indices })
32636435f1SJoel Dice     }
33636435f1SJoel Dice     pub fn engine(&self) -> &wasmtime::Engine {
34636435f1SJoel Dice         self.instance_pre.engine()
35636435f1SJoel Dice     }
36636435f1SJoel Dice     pub fn instance_pre(&self) -> &wasmtime::component::InstancePre<_T> {
37636435f1SJoel Dice         &self.instance_pre
38636435f1SJoel Dice     }
39636435f1SJoel Dice     /// Instantiates a new instance of [`TheWorld`] within the
40636435f1SJoel Dice     /// `store` provided.
41636435f1SJoel Dice     ///
42636435f1SJoel Dice     /// This function will use `self` as the pre-instantiated
43636435f1SJoel Dice     /// instance to perform instantiation. Afterwards the preloaded
44636435f1SJoel Dice     /// indices in `self` are used to lookup all exports on the
45636435f1SJoel Dice     /// resulting instance.
461155d6dfSAlex Crichton     pub fn instantiate(
471155d6dfSAlex Crichton         &self,
481155d6dfSAlex Crichton         mut store: impl wasmtime::AsContextMut<Data = _T>,
491155d6dfSAlex Crichton     ) -> wasmtime::Result<TheWorld> {
501155d6dfSAlex Crichton         let mut store = store.as_context_mut();
511155d6dfSAlex Crichton         let instance = self.instance_pre.instantiate(&mut store)?;
521155d6dfSAlex Crichton         self.indices.load(&mut store, &instance)
531155d6dfSAlex Crichton     }
541155d6dfSAlex Crichton }
551155d6dfSAlex Crichton impl<_T: Send + 'static> TheWorldPre<_T> {
561155d6dfSAlex Crichton     /// Same as [`Self::instantiate`], except with `async`.
57636435f1SJoel Dice     pub async fn instantiate_async(
58636435f1SJoel Dice         &self,
59636435f1SJoel Dice         mut store: impl wasmtime::AsContextMut<Data = _T>,
601155d6dfSAlex Crichton     ) -> wasmtime::Result<TheWorld> {
61636435f1SJoel Dice         let mut store = store.as_context_mut();
62636435f1SJoel Dice         let instance = self.instance_pre.instantiate_async(&mut store).await?;
63636435f1SJoel Dice         self.indices.load(&mut store, &instance)
64636435f1SJoel Dice     }
65636435f1SJoel Dice }
66636435f1SJoel Dice /// Auto-generated bindings for index of the exports of
67636435f1SJoel Dice /// `the-world`.
68636435f1SJoel Dice ///
69636435f1SJoel Dice /// This is an implementation detail of [`TheWorldPre`] and can
70636435f1SJoel Dice /// be constructed if needed as well.
71636435f1SJoel Dice ///
72636435f1SJoel Dice /// For more information see [`TheWorld`] as well.
73636435f1SJoel Dice #[derive(Clone)]
74636435f1SJoel Dice pub struct TheWorldIndices {
75636435f1SJoel Dice     interface0: exports::foo::foo::strings::GuestIndices,
76636435f1SJoel Dice }
77636435f1SJoel Dice /// Auto-generated bindings for an instance a component which
78636435f1SJoel Dice /// implements the world `the-world`.
79636435f1SJoel Dice ///
80636435f1SJoel Dice /// This structure can be created through a number of means
81636435f1SJoel Dice /// depending on your requirements and what you have on hand:
82636435f1SJoel Dice ///
83636435f1SJoel Dice /// * The most convenient way is to use
841155d6dfSAlex Crichton ///   [`TheWorld::instantiate`] which only needs a
85636435f1SJoel Dice ///   [`Store`], [`Component`], and [`Linker`].
86636435f1SJoel Dice ///
87636435f1SJoel Dice /// * Alternatively you can create a [`TheWorldPre`] ahead of
88636435f1SJoel Dice ///   time with a [`Component`] to front-load string lookups
89636435f1SJoel Dice ///   of exports once instead of per-instantiation. This
901155d6dfSAlex Crichton ///   method then uses [`TheWorldPre::instantiate`] to
91636435f1SJoel Dice ///   create a [`TheWorld`].
92636435f1SJoel Dice ///
93636435f1SJoel Dice /// * If you've instantiated the instance yourself already
94636435f1SJoel Dice ///   then you can use [`TheWorld::new`].
95636435f1SJoel Dice ///
96636435f1SJoel Dice /// These methods are all equivalent to one another and move
97636435f1SJoel Dice /// around the tradeoff of what work is performed when.
98636435f1SJoel Dice ///
99636435f1SJoel Dice /// [`Store`]: wasmtime::Store
100636435f1SJoel Dice /// [`Component`]: wasmtime::component::Component
101636435f1SJoel Dice /// [`Linker`]: wasmtime::component::Linker
102636435f1SJoel Dice pub struct TheWorld {
103636435f1SJoel Dice     interface0: exports::foo::foo::strings::Guest,
104636435f1SJoel Dice }
105636435f1SJoel Dice const _: () = {
106636435f1SJoel Dice     #[allow(unused_imports)]
107636435f1SJoel Dice     use wasmtime::component::__internal::anyhow;
108636435f1SJoel Dice     impl TheWorldIndices {
109636435f1SJoel Dice         /// Creates a new copy of `TheWorldIndices` bindings which can then
110636435f1SJoel Dice         /// be used to instantiate into a particular store.
111636435f1SJoel Dice         ///
112636435f1SJoel Dice         /// This method may fail if the component does not have the
113636435f1SJoel Dice         /// required exports.
114bb77f602SPat Hickey         pub fn new<_T>(
115bb77f602SPat Hickey             _instance_pre: &wasmtime::component::InstancePre<_T>,
116636435f1SJoel Dice         ) -> wasmtime::Result<Self> {
117bb77f602SPat Hickey             let _component = _instance_pre.component();
118bb77f602SPat Hickey             let _instance_type = _instance_pre.instance_type();
119bb77f602SPat Hickey             let interface0 = exports::foo::foo::strings::GuestIndices::new(
120bb77f602SPat Hickey                 _instance_pre,
121636435f1SJoel Dice             )?;
122636435f1SJoel Dice             Ok(TheWorldIndices { interface0 })
123636435f1SJoel Dice         }
124636435f1SJoel Dice         /// Uses the indices stored in `self` to load an instance
125636435f1SJoel Dice         /// of [`TheWorld`] from the instance provided.
126636435f1SJoel Dice         ///
127636435f1SJoel Dice         /// Note that at this time this method will additionally
128636435f1SJoel Dice         /// perform type-checks of all exports.
129636435f1SJoel Dice         pub fn load(
130636435f1SJoel Dice             &self,
131636435f1SJoel Dice             mut store: impl wasmtime::AsContextMut,
132636435f1SJoel Dice             instance: &wasmtime::component::Instance,
133636435f1SJoel Dice         ) -> wasmtime::Result<TheWorld> {
134bb77f602SPat Hickey             let _ = &mut store;
135636435f1SJoel Dice             let _instance = instance;
136636435f1SJoel Dice             let interface0 = self.interface0.load(&mut store, &_instance)?;
137636435f1SJoel Dice             Ok(TheWorld { interface0 })
138636435f1SJoel Dice         }
139636435f1SJoel Dice     }
140636435f1SJoel Dice     impl TheWorld {
141636435f1SJoel Dice         /// Convenience wrapper around [`TheWorldPre::new`] and
1421155d6dfSAlex Crichton         /// [`TheWorldPre::instantiate`].
1431155d6dfSAlex Crichton         pub fn instantiate<_T>(
1441155d6dfSAlex Crichton             store: impl wasmtime::AsContextMut<Data = _T>,
1451155d6dfSAlex Crichton             component: &wasmtime::component::Component,
1461155d6dfSAlex Crichton             linker: &wasmtime::component::Linker<_T>,
1471155d6dfSAlex Crichton         ) -> wasmtime::Result<TheWorld> {
1481155d6dfSAlex Crichton             let pre = linker.instantiate_pre(component)?;
1491155d6dfSAlex Crichton             TheWorldPre::new(pre)?.instantiate(store)
1501155d6dfSAlex Crichton         }
1511155d6dfSAlex Crichton         /// Convenience wrapper around [`TheWorldIndices::new`] and
1521155d6dfSAlex Crichton         /// [`TheWorldIndices::load`].
1531155d6dfSAlex Crichton         pub fn new(
1541155d6dfSAlex Crichton             mut store: impl wasmtime::AsContextMut,
1551155d6dfSAlex Crichton             instance: &wasmtime::component::Instance,
1561155d6dfSAlex Crichton         ) -> wasmtime::Result<TheWorld> {
1571155d6dfSAlex Crichton             let indices = TheWorldIndices::new(&instance.instance_pre(&store))?;
1581155d6dfSAlex Crichton             indices.load(&mut store, instance)
1591155d6dfSAlex Crichton         }
1601155d6dfSAlex Crichton         /// Convenience wrapper around [`TheWorldPre::new`] and
161636435f1SJoel Dice         /// [`TheWorldPre::instantiate_async`].
162636435f1SJoel Dice         pub async fn instantiate_async<_T>(
163bb77f602SPat Hickey             store: impl wasmtime::AsContextMut<Data = _T>,
164636435f1SJoel Dice             component: &wasmtime::component::Component,
165636435f1SJoel Dice             linker: &wasmtime::component::Linker<_T>,
166636435f1SJoel Dice         ) -> wasmtime::Result<TheWorld>
167636435f1SJoel Dice         where
168beca86b0SAlex Crichton             _T: Send,
169636435f1SJoel Dice         {
170636435f1SJoel Dice             let pre = linker.instantiate_pre(component)?;
171636435f1SJoel Dice             TheWorldPre::new(pre)?.instantiate_async(store).await
172636435f1SJoel Dice         }
173beca86b0SAlex Crichton         pub fn add_to_linker<T, D>(
174636435f1SJoel Dice             linker: &mut wasmtime::component::Linker<T>,
175beca86b0SAlex Crichton             host_getter: fn(&mut T) -> D::Data<'_>,
176636435f1SJoel Dice         ) -> wasmtime::Result<()>
177636435f1SJoel Dice         where
1781155d6dfSAlex Crichton             D: foo::foo::strings::HostWithStore + Send,
179beca86b0SAlex Crichton             for<'a> D::Data<'a>: foo::foo::strings::Host + Send,
180beca86b0SAlex Crichton             T: 'static + Send,
181636435f1SJoel Dice         {
182beca86b0SAlex Crichton             foo::foo::strings::add_to_linker::<T, D>(linker, host_getter)?;
183636435f1SJoel Dice             Ok(())
184636435f1SJoel Dice         }
185636435f1SJoel Dice         pub fn foo_foo_strings(&self) -> &exports::foo::foo::strings::Guest {
186636435f1SJoel Dice             &self.interface0
187636435f1SJoel Dice         }
188636435f1SJoel Dice     }
189636435f1SJoel Dice };
190636435f1SJoel Dice pub mod foo {
191636435f1SJoel Dice     pub mod foo {
192636435f1SJoel Dice         #[allow(clippy::all)]
193636435f1SJoel Dice         pub mod strings {
194636435f1SJoel Dice             #[allow(unused_imports)]
195636435f1SJoel Dice             use wasmtime::component::__internal::{anyhow, Box};
1961155d6dfSAlex Crichton             pub trait HostWithStore: wasmtime::component::HasData + Send {
1979f47be2eSAlex Crichton                 fn a<T>(
19864bc3bd9SAlex Crichton                     accessor: &wasmtime::component::Accessor<T, Self>,
199636435f1SJoel Dice                     x: wasmtime::component::__internal::String,
2001155d6dfSAlex Crichton                 ) -> impl ::core::future::Future<Output = ()> + Send;
2019f47be2eSAlex Crichton                 fn b<T>(
20264bc3bd9SAlex Crichton                     accessor: &wasmtime::component::Accessor<T, Self>,
203f063003eSPat Hickey                 ) -> impl ::core::future::Future<
204beca86b0SAlex Crichton                     Output = wasmtime::component::__internal::String,
2051155d6dfSAlex Crichton                 > + Send;
2069f47be2eSAlex Crichton                 fn c<T>(
20764bc3bd9SAlex Crichton                     accessor: &wasmtime::component::Accessor<T, Self>,
208636435f1SJoel Dice                     a: wasmtime::component::__internal::String,
209636435f1SJoel Dice                     b: wasmtime::component::__internal::String,
210f063003eSPat Hickey                 ) -> impl ::core::future::Future<
211beca86b0SAlex Crichton                     Output = wasmtime::component::__internal::String,
2121155d6dfSAlex Crichton                 > + Send;
213636435f1SJoel Dice             }
214beca86b0SAlex Crichton             pub trait Host: Send {}
215beca86b0SAlex Crichton             impl<_T: Host + ?Sized + Send> Host for &mut _T {}
216beca86b0SAlex Crichton             pub fn add_to_linker<T, D>(
217636435f1SJoel Dice                 linker: &mut wasmtime::component::Linker<T>,
218beca86b0SAlex Crichton                 host_getter: fn(&mut T) -> D::Data<'_>,
219636435f1SJoel Dice             ) -> wasmtime::Result<()>
220636435f1SJoel Dice             where
2211155d6dfSAlex Crichton                 D: HostWithStore,
222beca86b0SAlex Crichton                 for<'a> D::Data<'a>: Host,
223beca86b0SAlex Crichton                 T: 'static + Send,
224636435f1SJoel Dice             {
225636435f1SJoel Dice                 let mut inst = linker.instance("foo:foo/strings")?;
226636435f1SJoel Dice                 inst.func_wrap_concurrent(
227636435f1SJoel Dice                     "a",
228636435f1SJoel Dice                     move |
22964bc3bd9SAlex Crichton                         caller: &wasmtime::component::Accessor<T>,
230636435f1SJoel Dice                         (arg0,): (wasmtime::component::__internal::String,)|
231636435f1SJoel Dice                     {
232beca86b0SAlex Crichton                         wasmtime::component::__internal::Box::pin(async move {
2339f47be2eSAlex Crichton                             let host = &caller.with_getter(host_getter);
2349f47be2eSAlex Crichton                             let r = <D as HostWithStore>::a(host, arg0).await;
235636435f1SJoel Dice                             Ok(r)
236636435f1SJoel Dice                         })
237636435f1SJoel Dice                     },
238636435f1SJoel Dice                 )?;
239636435f1SJoel Dice                 inst.func_wrap_concurrent(
240636435f1SJoel Dice                     "b",
24164bc3bd9SAlex Crichton                     move |caller: &wasmtime::component::Accessor<T>, (): ()| {
242beca86b0SAlex Crichton                         wasmtime::component::__internal::Box::pin(async move {
2439f47be2eSAlex Crichton                             let host = &caller.with_getter(host_getter);
2449f47be2eSAlex Crichton                             let r = <D as HostWithStore>::b(host).await;
245636435f1SJoel Dice                             Ok((r,))
246636435f1SJoel Dice                         })
247636435f1SJoel Dice                     },
248636435f1SJoel Dice                 )?;
249636435f1SJoel Dice                 inst.func_wrap_concurrent(
250636435f1SJoel Dice                     "c",
251636435f1SJoel Dice                     move |
25264bc3bd9SAlex Crichton                         caller: &wasmtime::component::Accessor<T>,
253636435f1SJoel Dice                         (
254636435f1SJoel Dice                             arg0,
255636435f1SJoel Dice                             arg1,
256636435f1SJoel Dice                         ): (
257636435f1SJoel Dice                             wasmtime::component::__internal::String,
258636435f1SJoel Dice                             wasmtime::component::__internal::String,
259636435f1SJoel Dice                         )|
260636435f1SJoel Dice                     {
261beca86b0SAlex Crichton                         wasmtime::component::__internal::Box::pin(async move {
2629f47be2eSAlex Crichton                             let host = &caller.with_getter(host_getter);
2639f47be2eSAlex Crichton                             let r = <D as HostWithStore>::c(host, arg0, arg1).await;
264636435f1SJoel Dice                             Ok((r,))
265636435f1SJoel Dice                         })
266636435f1SJoel Dice                     },
267636435f1SJoel Dice                 )?;
268636435f1SJoel Dice                 Ok(())
269636435f1SJoel Dice             }
270636435f1SJoel Dice         }
271636435f1SJoel Dice     }
272636435f1SJoel Dice }
273636435f1SJoel Dice pub mod exports {
274636435f1SJoel Dice     pub mod foo {
275636435f1SJoel Dice         pub mod foo {
276636435f1SJoel Dice             #[allow(clippy::all)]
277636435f1SJoel Dice             pub mod strings {
278636435f1SJoel Dice                 #[allow(unused_imports)]
279636435f1SJoel Dice                 use wasmtime::component::__internal::{anyhow, Box};
280*fee9be21SAlex Crichton                 #[derive(Clone)]
281636435f1SJoel Dice                 pub struct Guest {
282636435f1SJoel Dice                     a: wasmtime::component::Func,
283636435f1SJoel Dice                     b: wasmtime::component::Func,
284636435f1SJoel Dice                     c: wasmtime::component::Func,
285636435f1SJoel Dice                 }
286636435f1SJoel Dice                 #[derive(Clone)]
287636435f1SJoel Dice                 pub struct GuestIndices {
288636435f1SJoel Dice                     a: wasmtime::component::ComponentExportIndex,
289636435f1SJoel Dice                     b: wasmtime::component::ComponentExportIndex,
290636435f1SJoel Dice                     c: wasmtime::component::ComponentExportIndex,
291636435f1SJoel Dice                 }
292636435f1SJoel Dice                 impl GuestIndices {
293636435f1SJoel Dice                     /// Constructor for [`GuestIndices`] which takes a
294636435f1SJoel Dice                     /// [`Component`](wasmtime::component::Component) as input and can be executed
295636435f1SJoel Dice                     /// before instantiation.
296636435f1SJoel Dice                     ///
297636435f1SJoel Dice                     /// This constructor can be used to front-load string lookups to find exports
298636435f1SJoel Dice                     /// within a component.
299bb77f602SPat Hickey                     pub fn new<_T>(
300bb77f602SPat Hickey                         _instance_pre: &wasmtime::component::InstancePre<_T>,
301636435f1SJoel Dice                     ) -> wasmtime::Result<GuestIndices> {
302bb77f602SPat Hickey                         let instance = _instance_pre
303bb77f602SPat Hickey                             .component()
30495cc0297SPat Hickey                             .get_export_index(None, "foo:foo/strings")
305636435f1SJoel Dice                             .ok_or_else(|| {
306636435f1SJoel Dice                                 anyhow::anyhow!(
307636435f1SJoel Dice                                     "no exported instance named `foo:foo/strings`"
308636435f1SJoel Dice                                 )
309636435f1SJoel Dice                             })?;
310636435f1SJoel Dice                         let mut lookup = move |name| {
311bb77f602SPat Hickey                             _instance_pre
312bb77f602SPat Hickey                                 .component()
313bb77f602SPat Hickey                                 .get_export_index(Some(&instance), name)
314636435f1SJoel Dice                                 .ok_or_else(|| {
315636435f1SJoel Dice                                     anyhow::anyhow!(
316636435f1SJoel Dice                                         "instance export `foo:foo/strings` does \
317636435f1SJoel Dice                 not have export `{name}`"
318636435f1SJoel Dice                                     )
319636435f1SJoel Dice                                 })
320636435f1SJoel Dice                         };
321636435f1SJoel Dice                         let _ = &mut lookup;
322636435f1SJoel Dice                         let a = lookup("a")?;
323636435f1SJoel Dice                         let b = lookup("b")?;
324636435f1SJoel Dice                         let c = lookup("c")?;
325636435f1SJoel Dice                         Ok(GuestIndices { a, b, c })
326636435f1SJoel Dice                     }
327636435f1SJoel Dice                     pub fn load(
328636435f1SJoel Dice                         &self,
329636435f1SJoel Dice                         mut store: impl wasmtime::AsContextMut,
330636435f1SJoel Dice                         instance: &wasmtime::component::Instance,
331636435f1SJoel Dice                     ) -> wasmtime::Result<Guest> {
332bb77f602SPat Hickey                         let _instance = instance;
333bb77f602SPat Hickey                         let _instance_pre = _instance.instance_pre(&store);
334bb77f602SPat Hickey                         let _instance_type = _instance_pre.instance_type();
335636435f1SJoel Dice                         let mut store = store.as_context_mut();
336636435f1SJoel Dice                         let _ = &mut store;
337636435f1SJoel Dice                         let a = *_instance
338636435f1SJoel Dice                             .get_typed_func::<(&str,), ()>(&mut store, &self.a)?
339636435f1SJoel Dice                             .func();
340636435f1SJoel Dice                         let b = *_instance
341636435f1SJoel Dice                             .get_typed_func::<
342636435f1SJoel Dice                                 (),
343636435f1SJoel Dice                                 (wasmtime::component::__internal::String,),
344636435f1SJoel Dice                             >(&mut store, &self.b)?
345636435f1SJoel Dice                             .func();
346636435f1SJoel Dice                         let c = *_instance
347636435f1SJoel Dice                             .get_typed_func::<
348636435f1SJoel Dice                                 (&str, &str),
349636435f1SJoel Dice                                 (wasmtime::component::__internal::String,),
350636435f1SJoel Dice                             >(&mut store, &self.c)?
351636435f1SJoel Dice                             .func();
352636435f1SJoel Dice                         Ok(Guest { a, b, c })
353636435f1SJoel Dice                     }
354636435f1SJoel Dice                 }
355636435f1SJoel Dice                 impl Guest {
35664bc3bd9SAlex Crichton                     pub async fn call_a<_T, _D>(
357636435f1SJoel Dice                         &self,
35864bc3bd9SAlex Crichton                         accessor: &wasmtime::component::Accessor<_T, _D>,
359636435f1SJoel Dice                         arg0: wasmtime::component::__internal::String,
36064bc3bd9SAlex Crichton                     ) -> wasmtime::Result<()>
361636435f1SJoel Dice                     where
36264bc3bd9SAlex Crichton                         _T: Send,
36364bc3bd9SAlex Crichton                         _D: wasmtime::component::HasData,
364636435f1SJoel Dice                     {
365636435f1SJoel Dice                         let callee = unsafe {
366636435f1SJoel Dice                             wasmtime::component::TypedFunc::<
367636435f1SJoel Dice                                 (wasmtime::component::__internal::String,),
368636435f1SJoel Dice                                 (),
369636435f1SJoel Dice                             >::new_unchecked(self.a)
370636435f1SJoel Dice                         };
371080faa1aSJoel Dice                         let ((), _) = callee.call_concurrent(accessor, (arg0,)).await?;
37264bc3bd9SAlex Crichton                         Ok(())
373636435f1SJoel Dice                     }
37464bc3bd9SAlex Crichton                     pub async fn call_b<_T, _D>(
375636435f1SJoel Dice                         &self,
37664bc3bd9SAlex Crichton                         accessor: &wasmtime::component::Accessor<_T, _D>,
37764bc3bd9SAlex Crichton                     ) -> wasmtime::Result<wasmtime::component::__internal::String>
378636435f1SJoel Dice                     where
37964bc3bd9SAlex Crichton                         _T: Send,
38064bc3bd9SAlex Crichton                         _D: wasmtime::component::HasData,
381636435f1SJoel Dice                     {
382636435f1SJoel Dice                         let callee = unsafe {
383636435f1SJoel Dice                             wasmtime::component::TypedFunc::<
384636435f1SJoel Dice                                 (),
385636435f1SJoel Dice                                 (wasmtime::component::__internal::String,),
386636435f1SJoel Dice                             >::new_unchecked(self.b)
387636435f1SJoel Dice                         };
388080faa1aSJoel Dice                         let ((ret0,), _) = callee.call_concurrent(accessor, ()).await?;
389b221fca7SJoel Dice                         Ok(ret0)
390b221fca7SJoel Dice                     }
39164bc3bd9SAlex Crichton                     pub async fn call_c<_T, _D>(
392636435f1SJoel Dice                         &self,
39364bc3bd9SAlex Crichton                         accessor: &wasmtime::component::Accessor<_T, _D>,
394636435f1SJoel Dice                         arg0: wasmtime::component::__internal::String,
395636435f1SJoel Dice                         arg1: wasmtime::component::__internal::String,
39664bc3bd9SAlex Crichton                     ) -> wasmtime::Result<wasmtime::component::__internal::String>
397636435f1SJoel Dice                     where
39864bc3bd9SAlex Crichton                         _T: Send,
39964bc3bd9SAlex Crichton                         _D: wasmtime::component::HasData,
400636435f1SJoel Dice                     {
401636435f1SJoel Dice                         let callee = unsafe {
402636435f1SJoel Dice                             wasmtime::component::TypedFunc::<
403636435f1SJoel Dice                                 (
404636435f1SJoel Dice                                     wasmtime::component::__internal::String,
405636435f1SJoel Dice                                     wasmtime::component::__internal::String,
406636435f1SJoel Dice                                 ),
407636435f1SJoel Dice                                 (wasmtime::component::__internal::String,),
408636435f1SJoel Dice                             >::new_unchecked(self.c)
409636435f1SJoel Dice                         };
410080faa1aSJoel Dice                         let ((ret0,), _) = callee
41164bc3bd9SAlex Crichton                             .call_concurrent(accessor, (arg0, arg1))
412080faa1aSJoel Dice                             .await?;
413b221fca7SJoel Dice                         Ok(ret0)
414b221fca7SJoel Dice                     }
415636435f1SJoel Dice                 }
416636435f1SJoel Dice             }
417636435f1SJoel Dice         }
418636435f1SJoel Dice     }
419636435f1SJoel Dice }
420