Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs
3092 views
1
/// Auto-generated bindings for a pre-instantiated version of a
2
/// component which implements the world `the-world`.
3
///
4
/// This structure is created through [`TheWorldPre::new`] which
5
/// takes a [`InstancePre`](wasmtime::component::InstancePre) that
6
/// has been created through a [`Linker`](wasmtime::component::Linker).
7
///
8
/// For more information see [`TheWorld`] as well.
9
pub struct TheWorldPre<T: 'static> {
10
instance_pre: wasmtime::component::InstancePre<T>,
11
indices: TheWorldIndices,
12
}
13
impl<T: 'static> Clone for TheWorldPre<T> {
14
fn clone(&self) -> Self {
15
Self {
16
instance_pre: self.instance_pre.clone(),
17
indices: self.indices.clone(),
18
}
19
}
20
}
21
impl<_T: 'static> TheWorldPre<_T> {
22
/// Creates a new copy of `TheWorldPre` bindings which can then
23
/// be used to instantiate into a particular store.
24
///
25
/// This method may fail if the component behind `instance_pre`
26
/// does not have the required exports.
27
pub fn new(
28
instance_pre: wasmtime::component::InstancePre<_T>,
29
) -> wasmtime::Result<Self> {
30
let indices = TheWorldIndices::new(&instance_pre)?;
31
Ok(Self { instance_pre, indices })
32
}
33
pub fn engine(&self) -> &wasmtime::Engine {
34
self.instance_pre.engine()
35
}
36
pub fn instance_pre(&self) -> &wasmtime::component::InstancePre<_T> {
37
&self.instance_pre
38
}
39
/// Instantiates a new instance of [`TheWorld`] within the
40
/// `store` provided.
41
///
42
/// This function will use `self` as the pre-instantiated
43
/// instance to perform instantiation. Afterwards the preloaded
44
/// indices in `self` are used to lookup all exports on the
45
/// resulting instance.
46
pub fn instantiate(
47
&self,
48
mut store: impl wasmtime::AsContextMut<Data = _T>,
49
) -> wasmtime::Result<TheWorld> {
50
let mut store = store.as_context_mut();
51
let instance = self.instance_pre.instantiate(&mut store)?;
52
self.indices.load(&mut store, &instance)
53
}
54
}
55
impl<_T: Send + 'static> TheWorldPre<_T> {
56
/// Same as [`Self::instantiate`], except with `async`.
57
pub async fn instantiate_async(
58
&self,
59
mut store: impl wasmtime::AsContextMut<Data = _T>,
60
) -> wasmtime::Result<TheWorld> {
61
let mut store = store.as_context_mut();
62
let instance = self.instance_pre.instantiate_async(&mut store).await?;
63
self.indices.load(&mut store, &instance)
64
}
65
}
66
/// Auto-generated bindings for index of the exports of
67
/// `the-world`.
68
///
69
/// This is an implementation detail of [`TheWorldPre`] and can
70
/// be constructed if needed as well.
71
///
72
/// For more information see [`TheWorld`] as well.
73
#[derive(Clone)]
74
pub struct TheWorldIndices {
75
interface0: exports::foo::foo::manyarg::GuestIndices,
76
}
77
/// Auto-generated bindings for an instance a component which
78
/// implements the world `the-world`.
79
///
80
/// This structure can be created through a number of means
81
/// depending on your requirements and what you have on hand:
82
///
83
/// * The most convenient way is to use
84
/// [`TheWorld::instantiate`] which only needs a
85
/// [`Store`], [`Component`], and [`Linker`].
86
///
87
/// * Alternatively you can create a [`TheWorldPre`] ahead of
88
/// time with a [`Component`] to front-load string lookups
89
/// of exports once instead of per-instantiation. This
90
/// method then uses [`TheWorldPre::instantiate`] to
91
/// create a [`TheWorld`].
92
///
93
/// * If you've instantiated the instance yourself already
94
/// then you can use [`TheWorld::new`].
95
///
96
/// These methods are all equivalent to one another and move
97
/// around the tradeoff of what work is performed when.
98
///
99
/// [`Store`]: wasmtime::Store
100
/// [`Component`]: wasmtime::component::Component
101
/// [`Linker`]: wasmtime::component::Linker
102
pub struct TheWorld {
103
interface0: exports::foo::foo::manyarg::Guest,
104
}
105
const _: () = {
106
impl TheWorldIndices {
107
/// Creates a new copy of `TheWorldIndices` bindings which can then
108
/// be used to instantiate into a particular store.
109
///
110
/// This method may fail if the component does not have the
111
/// required exports.
112
pub fn new<_T>(
113
_instance_pre: &wasmtime::component::InstancePre<_T>,
114
) -> wasmtime::Result<Self> {
115
let _component = _instance_pre.component();
116
let _instance_type = _instance_pre.instance_type();
117
let interface0 = exports::foo::foo::manyarg::GuestIndices::new(
118
_instance_pre,
119
)?;
120
Ok(TheWorldIndices { interface0 })
121
}
122
/// Uses the indices stored in `self` to load an instance
123
/// of [`TheWorld`] from the instance provided.
124
///
125
/// Note that at this time this method will additionally
126
/// perform type-checks of all exports.
127
pub fn load(
128
&self,
129
mut store: impl wasmtime::AsContextMut,
130
instance: &wasmtime::component::Instance,
131
) -> wasmtime::Result<TheWorld> {
132
let _ = &mut store;
133
let _instance = instance;
134
let interface0 = self.interface0.load(&mut store, &_instance)?;
135
Ok(TheWorld { interface0 })
136
}
137
}
138
impl TheWorld {
139
/// Convenience wrapper around [`TheWorldPre::new`] and
140
/// [`TheWorldPre::instantiate`].
141
pub fn instantiate<_T>(
142
store: impl wasmtime::AsContextMut<Data = _T>,
143
component: &wasmtime::component::Component,
144
linker: &wasmtime::component::Linker<_T>,
145
) -> wasmtime::Result<TheWorld> {
146
let pre = linker.instantiate_pre(component)?;
147
TheWorldPre::new(pre)?.instantiate(store)
148
}
149
/// Convenience wrapper around [`TheWorldIndices::new`] and
150
/// [`TheWorldIndices::load`].
151
pub fn new(
152
mut store: impl wasmtime::AsContextMut,
153
instance: &wasmtime::component::Instance,
154
) -> wasmtime::Result<TheWorld> {
155
let indices = TheWorldIndices::new(&instance.instance_pre(&store))?;
156
indices.load(&mut store, instance)
157
}
158
/// Convenience wrapper around [`TheWorldPre::new`] and
159
/// [`TheWorldPre::instantiate_async`].
160
pub async fn instantiate_async<_T>(
161
store: impl wasmtime::AsContextMut<Data = _T>,
162
component: &wasmtime::component::Component,
163
linker: &wasmtime::component::Linker<_T>,
164
) -> wasmtime::Result<TheWorld>
165
where
166
_T: Send,
167
{
168
let pre = linker.instantiate_pre(component)?;
169
TheWorldPre::new(pre)?.instantiate_async(store).await
170
}
171
pub fn add_to_linker<T, D>(
172
linker: &mut wasmtime::component::Linker<T>,
173
host_getter: fn(&mut T) -> D::Data<'_>,
174
) -> wasmtime::Result<()>
175
where
176
D: foo::foo::manyarg::HostWithStore + Send,
177
for<'a> D::Data<'a>: foo::foo::manyarg::Host + Send,
178
T: 'static + Send,
179
{
180
foo::foo::manyarg::add_to_linker::<T, D>(linker, host_getter)?;
181
Ok(())
182
}
183
pub fn foo_foo_manyarg(&self) -> &exports::foo::foo::manyarg::Guest {
184
&self.interface0
185
}
186
}
187
};
188
pub mod foo {
189
pub mod foo {
190
#[allow(clippy::all)]
191
pub mod manyarg {
192
#[allow(unused_imports)]
193
use wasmtime::component::__internal::Box;
194
#[derive(wasmtime::component::ComponentType)]
195
#[derive(wasmtime::component::Lift)]
196
#[derive(wasmtime::component::Lower)]
197
#[component(record)]
198
#[derive(Clone)]
199
pub struct BigStruct {
200
#[component(name = "a1")]
201
pub a1: wasmtime::component::__internal::String,
202
#[component(name = "a2")]
203
pub a2: wasmtime::component::__internal::String,
204
#[component(name = "a3")]
205
pub a3: wasmtime::component::__internal::String,
206
#[component(name = "a4")]
207
pub a4: wasmtime::component::__internal::String,
208
#[component(name = "a5")]
209
pub a5: wasmtime::component::__internal::String,
210
#[component(name = "a6")]
211
pub a6: wasmtime::component::__internal::String,
212
#[component(name = "a7")]
213
pub a7: wasmtime::component::__internal::String,
214
#[component(name = "a8")]
215
pub a8: wasmtime::component::__internal::String,
216
#[component(name = "a9")]
217
pub a9: wasmtime::component::__internal::String,
218
#[component(name = "a10")]
219
pub a10: wasmtime::component::__internal::String,
220
#[component(name = "a11")]
221
pub a11: wasmtime::component::__internal::String,
222
#[component(name = "a12")]
223
pub a12: wasmtime::component::__internal::String,
224
#[component(name = "a13")]
225
pub a13: wasmtime::component::__internal::String,
226
#[component(name = "a14")]
227
pub a14: wasmtime::component::__internal::String,
228
#[component(name = "a15")]
229
pub a15: wasmtime::component::__internal::String,
230
#[component(name = "a16")]
231
pub a16: wasmtime::component::__internal::String,
232
#[component(name = "a17")]
233
pub a17: wasmtime::component::__internal::String,
234
#[component(name = "a18")]
235
pub a18: wasmtime::component::__internal::String,
236
#[component(name = "a19")]
237
pub a19: wasmtime::component::__internal::String,
238
#[component(name = "a20")]
239
pub a20: wasmtime::component::__internal::String,
240
}
241
impl core::fmt::Debug for BigStruct {
242
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
243
f.debug_struct("BigStruct")
244
.field("a1", &self.a1)
245
.field("a2", &self.a2)
246
.field("a3", &self.a3)
247
.field("a4", &self.a4)
248
.field("a5", &self.a5)
249
.field("a6", &self.a6)
250
.field("a7", &self.a7)
251
.field("a8", &self.a8)
252
.field("a9", &self.a9)
253
.field("a10", &self.a10)
254
.field("a11", &self.a11)
255
.field("a12", &self.a12)
256
.field("a13", &self.a13)
257
.field("a14", &self.a14)
258
.field("a15", &self.a15)
259
.field("a16", &self.a16)
260
.field("a17", &self.a17)
261
.field("a18", &self.a18)
262
.field("a19", &self.a19)
263
.field("a20", &self.a20)
264
.finish()
265
}
266
}
267
const _: () = {
268
assert!(
269
160 == < BigStruct as wasmtime::component::ComponentType >::SIZE32
270
);
271
assert!(
272
4 == < BigStruct as wasmtime::component::ComponentType >::ALIGN32
273
);
274
};
275
pub trait HostWithStore: wasmtime::component::HasData + Send {}
276
impl<_T: ?Sized> HostWithStore for _T
277
where
278
_T: wasmtime::component::HasData + Send,
279
{}
280
pub trait Host: Send {
281
fn many_args(
282
&mut self,
283
a1: u64,
284
a2: u64,
285
a3: u64,
286
a4: u64,
287
a5: u64,
288
a6: u64,
289
a7: u64,
290
a8: u64,
291
a9: u64,
292
a10: u64,
293
a11: u64,
294
a12: u64,
295
a13: u64,
296
a14: u64,
297
a15: u64,
298
a16: u64,
299
) -> impl ::core::future::Future<Output = ()> + Send;
300
fn big_argument(
301
&mut self,
302
x: BigStruct,
303
) -> impl ::core::future::Future<Output = ()> + Send;
304
}
305
impl<_T: Host + ?Sized + Send> Host for &mut _T {
306
fn many_args(
307
&mut self,
308
a1: u64,
309
a2: u64,
310
a3: u64,
311
a4: u64,
312
a5: u64,
313
a6: u64,
314
a7: u64,
315
a8: u64,
316
a9: u64,
317
a10: u64,
318
a11: u64,
319
a12: u64,
320
a13: u64,
321
a14: u64,
322
a15: u64,
323
a16: u64,
324
) -> impl ::core::future::Future<Output = ()> + Send {
325
async move {
326
Host::many_args(
327
*self,
328
a1,
329
a2,
330
a3,
331
a4,
332
a5,
333
a6,
334
a7,
335
a8,
336
a9,
337
a10,
338
a11,
339
a12,
340
a13,
341
a14,
342
a15,
343
a16,
344
)
345
.await
346
}
347
}
348
fn big_argument(
349
&mut self,
350
x: BigStruct,
351
) -> impl ::core::future::Future<Output = ()> + Send {
352
async move { Host::big_argument(*self, x).await }
353
}
354
}
355
pub fn add_to_linker<T, D>(
356
linker: &mut wasmtime::component::Linker<T>,
357
host_getter: fn(&mut T) -> D::Data<'_>,
358
) -> wasmtime::Result<()>
359
where
360
D: HostWithStore,
361
for<'a> D::Data<'a>: Host,
362
T: 'static + Send,
363
{
364
let mut inst = linker.instance("foo:foo/manyarg")?;
365
inst.func_wrap_async(
366
"many-args",
367
move |
368
mut caller: wasmtime::StoreContextMut<'_, T>,
369
(
370
arg0,
371
arg1,
372
arg2,
373
arg3,
374
arg4,
375
arg5,
376
arg6,
377
arg7,
378
arg8,
379
arg9,
380
arg10,
381
arg11,
382
arg12,
383
arg13,
384
arg14,
385
arg15,
386
): (
387
u64,
388
u64,
389
u64,
390
u64,
391
u64,
392
u64,
393
u64,
394
u64,
395
u64,
396
u64,
397
u64,
398
u64,
399
u64,
400
u64,
401
u64,
402
u64,
403
)|
404
{
405
use tracing::Instrument;
406
let span = tracing::span!(
407
tracing::Level::TRACE, "wit-bindgen import", module =
408
"manyarg", function = "many-args",
409
);
410
wasmtime::component::__internal::Box::new(
411
async move {
412
tracing::event!(
413
tracing::Level::TRACE, a1 = tracing::field::debug(& arg0),
414
a2 = tracing::field::debug(& arg1), a3 =
415
tracing::field::debug(& arg2), a4 = tracing::field::debug(&
416
arg3), a5 = tracing::field::debug(& arg4), a6 =
417
tracing::field::debug(& arg5), a7 = tracing::field::debug(&
418
arg6), a8 = tracing::field::debug(& arg7), a9 =
419
tracing::field::debug(& arg8), a10 = tracing::field::debug(&
420
arg9), a11 = tracing::field::debug(& arg10), a12 =
421
tracing::field::debug(& arg11), a13 =
422
tracing::field::debug(& arg12), a14 =
423
tracing::field::debug(& arg13), a15 =
424
tracing::field::debug(& arg14), a16 =
425
tracing::field::debug(& arg15), "call"
426
);
427
let host = &mut host_getter(caller.data_mut());
428
let r = Host::many_args(
429
host,
430
arg0,
431
arg1,
432
arg2,
433
arg3,
434
arg4,
435
arg5,
436
arg6,
437
arg7,
438
arg8,
439
arg9,
440
arg10,
441
arg11,
442
arg12,
443
arg13,
444
arg14,
445
arg15,
446
)
447
.await;
448
tracing::event!(
449
tracing::Level::TRACE, result = tracing::field::debug(& r),
450
"return"
451
);
452
Ok(r)
453
}
454
.instrument(span),
455
)
456
},
457
)?;
458
inst.func_wrap_async(
459
"big-argument",
460
move |
461
mut caller: wasmtime::StoreContextMut<'_, T>,
462
(arg0,): (BigStruct,)|
463
{
464
use tracing::Instrument;
465
let span = tracing::span!(
466
tracing::Level::TRACE, "wit-bindgen import", module =
467
"manyarg", function = "big-argument",
468
);
469
wasmtime::component::__internal::Box::new(
470
async move {
471
tracing::event!(
472
tracing::Level::TRACE, x = tracing::field::debug(& arg0),
473
"call"
474
);
475
let host = &mut host_getter(caller.data_mut());
476
let r = Host::big_argument(host, arg0).await;
477
tracing::event!(
478
tracing::Level::TRACE, result = tracing::field::debug(& r),
479
"return"
480
);
481
Ok(r)
482
}
483
.instrument(span),
484
)
485
},
486
)?;
487
Ok(())
488
}
489
}
490
}
491
}
492
pub mod exports {
493
pub mod foo {
494
pub mod foo {
495
#[allow(clippy::all)]
496
pub mod manyarg {
497
#[allow(unused_imports)]
498
use wasmtime::component::__internal::Box;
499
#[derive(wasmtime::component::ComponentType)]
500
#[derive(wasmtime::component::Lift)]
501
#[derive(wasmtime::component::Lower)]
502
#[component(record)]
503
#[derive(Clone)]
504
pub struct BigStruct {
505
#[component(name = "a1")]
506
pub a1: wasmtime::component::__internal::String,
507
#[component(name = "a2")]
508
pub a2: wasmtime::component::__internal::String,
509
#[component(name = "a3")]
510
pub a3: wasmtime::component::__internal::String,
511
#[component(name = "a4")]
512
pub a4: wasmtime::component::__internal::String,
513
#[component(name = "a5")]
514
pub a5: wasmtime::component::__internal::String,
515
#[component(name = "a6")]
516
pub a6: wasmtime::component::__internal::String,
517
#[component(name = "a7")]
518
pub a7: wasmtime::component::__internal::String,
519
#[component(name = "a8")]
520
pub a8: wasmtime::component::__internal::String,
521
#[component(name = "a9")]
522
pub a9: wasmtime::component::__internal::String,
523
#[component(name = "a10")]
524
pub a10: wasmtime::component::__internal::String,
525
#[component(name = "a11")]
526
pub a11: wasmtime::component::__internal::String,
527
#[component(name = "a12")]
528
pub a12: wasmtime::component::__internal::String,
529
#[component(name = "a13")]
530
pub a13: wasmtime::component::__internal::String,
531
#[component(name = "a14")]
532
pub a14: wasmtime::component::__internal::String,
533
#[component(name = "a15")]
534
pub a15: wasmtime::component::__internal::String,
535
#[component(name = "a16")]
536
pub a16: wasmtime::component::__internal::String,
537
#[component(name = "a17")]
538
pub a17: wasmtime::component::__internal::String,
539
#[component(name = "a18")]
540
pub a18: wasmtime::component::__internal::String,
541
#[component(name = "a19")]
542
pub a19: wasmtime::component::__internal::String,
543
#[component(name = "a20")]
544
pub a20: wasmtime::component::__internal::String,
545
}
546
impl core::fmt::Debug for BigStruct {
547
fn fmt(
548
&self,
549
f: &mut core::fmt::Formatter<'_>,
550
) -> core::fmt::Result {
551
f.debug_struct("BigStruct")
552
.field("a1", &self.a1)
553
.field("a2", &self.a2)
554
.field("a3", &self.a3)
555
.field("a4", &self.a4)
556
.field("a5", &self.a5)
557
.field("a6", &self.a6)
558
.field("a7", &self.a7)
559
.field("a8", &self.a8)
560
.field("a9", &self.a9)
561
.field("a10", &self.a10)
562
.field("a11", &self.a11)
563
.field("a12", &self.a12)
564
.field("a13", &self.a13)
565
.field("a14", &self.a14)
566
.field("a15", &self.a15)
567
.field("a16", &self.a16)
568
.field("a17", &self.a17)
569
.field("a18", &self.a18)
570
.field("a19", &self.a19)
571
.field("a20", &self.a20)
572
.finish()
573
}
574
}
575
const _: () = {
576
assert!(
577
160 == < BigStruct as wasmtime::component::ComponentType
578
>::SIZE32
579
);
580
assert!(
581
4 == < BigStruct as wasmtime::component::ComponentType >::ALIGN32
582
);
583
};
584
#[derive(Clone)]
585
pub struct Guest {
586
many_args: wasmtime::component::Func,
587
big_argument: wasmtime::component::Func,
588
}
589
#[derive(Clone)]
590
pub struct GuestIndices {
591
many_args: wasmtime::component::ComponentExportIndex,
592
big_argument: wasmtime::component::ComponentExportIndex,
593
}
594
impl GuestIndices {
595
/// Constructor for [`GuestIndices`] which takes a
596
/// [`Component`](wasmtime::component::Component) as input and can be executed
597
/// before instantiation.
598
///
599
/// This constructor can be used to front-load string lookups to find exports
600
/// within a component.
601
pub fn new<_T>(
602
_instance_pre: &wasmtime::component::InstancePre<_T>,
603
) -> wasmtime::Result<GuestIndices> {
604
let instance = _instance_pre
605
.component()
606
.get_export_index(None, "foo:foo/manyarg")
607
.ok_or_else(|| {
608
wasmtime::format_err!(
609
"no exported instance named `foo:foo/manyarg`"
610
)
611
})?;
612
let mut lookup = move |name| {
613
_instance_pre
614
.component()
615
.get_export_index(Some(&instance), name)
616
.ok_or_else(|| {
617
wasmtime::format_err!(
618
"instance export `foo:foo/manyarg` does \
619
not have export `{name}`"
620
)
621
})
622
};
623
let _ = &mut lookup;
624
let many_args = lookup("many-args")?;
625
let big_argument = lookup("big-argument")?;
626
Ok(GuestIndices {
627
many_args,
628
big_argument,
629
})
630
}
631
pub fn load(
632
&self,
633
mut store: impl wasmtime::AsContextMut,
634
instance: &wasmtime::component::Instance,
635
) -> wasmtime::Result<Guest> {
636
let _instance = instance;
637
let _instance_pre = _instance.instance_pre(&store);
638
let _instance_type = _instance_pre.instance_type();
639
let mut store = store.as_context_mut();
640
let _ = &mut store;
641
let many_args = *_instance
642
.get_typed_func::<
643
(
644
u64,
645
u64,
646
u64,
647
u64,
648
u64,
649
u64,
650
u64,
651
u64,
652
u64,
653
u64,
654
u64,
655
u64,
656
u64,
657
u64,
658
u64,
659
u64,
660
),
661
(),
662
>(&mut store, &self.many_args)?
663
.func();
664
let big_argument = *_instance
665
.get_typed_func::<
666
(&BigStruct,),
667
(),
668
>(&mut store, &self.big_argument)?
669
.func();
670
Ok(Guest { many_args, big_argument })
671
}
672
}
673
impl Guest {
674
pub async fn call_many_args<S: wasmtime::AsContextMut>(
675
&self,
676
mut store: S,
677
arg0: u64,
678
arg1: u64,
679
arg2: u64,
680
arg3: u64,
681
arg4: u64,
682
arg5: u64,
683
arg6: u64,
684
arg7: u64,
685
arg8: u64,
686
arg9: u64,
687
arg10: u64,
688
arg11: u64,
689
arg12: u64,
690
arg13: u64,
691
arg14: u64,
692
arg15: u64,
693
) -> wasmtime::Result<()>
694
where
695
<S as wasmtime::AsContext>::Data: Send,
696
{
697
use tracing::Instrument;
698
let span = tracing::span!(
699
tracing::Level::TRACE, "wit-bindgen export", module =
700
"foo:foo/manyarg", function = "many-args",
701
);
702
let callee = unsafe {
703
wasmtime::component::TypedFunc::<
704
(
705
u64,
706
u64,
707
u64,
708
u64,
709
u64,
710
u64,
711
u64,
712
u64,
713
u64,
714
u64,
715
u64,
716
u64,
717
u64,
718
u64,
719
u64,
720
u64,
721
),
722
(),
723
>::new_unchecked(self.many_args)
724
};
725
let () = callee
726
.call_async(
727
store.as_context_mut(),
728
(
729
arg0,
730
arg1,
731
arg2,
732
arg3,
733
arg4,
734
arg5,
735
arg6,
736
arg7,
737
arg8,
738
arg9,
739
arg10,
740
arg11,
741
arg12,
742
arg13,
743
arg14,
744
arg15,
745
),
746
)
747
.instrument(span.clone())
748
.await?;
749
Ok(())
750
}
751
pub async fn call_big_argument<S: wasmtime::AsContextMut>(
752
&self,
753
mut store: S,
754
arg0: &BigStruct,
755
) -> wasmtime::Result<()>
756
where
757
<S as wasmtime::AsContext>::Data: Send,
758
{
759
use tracing::Instrument;
760
let span = tracing::span!(
761
tracing::Level::TRACE, "wit-bindgen export", module =
762
"foo:foo/manyarg", function = "big-argument",
763
);
764
let callee = unsafe {
765
wasmtime::component::TypedFunc::<
766
(&BigStruct,),
767
(),
768
>::new_unchecked(self.big_argument)
769
};
770
let () = callee
771
.call_async(store.as_context_mut(), (arg0,))
772
.instrument(span.clone())
773
.await?;
774
Ok(())
775
}
776
}
777
}
778
}
779
}
780
}
781
782