Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/component-macro/tests/expanded/lists.rs
1692 views
1
/// Auto-generated bindings for a pre-instantiated version of a
2
/// component which implements the world `the-lists`.
3
///
4
/// This structure is created through [`TheListsPre::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 [`TheLists`] as well.
9
pub struct TheListsPre<T: 'static> {
10
instance_pre: wasmtime::component::InstancePre<T>,
11
indices: TheListsIndices,
12
}
13
impl<T: 'static> Clone for TheListsPre<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> TheListsPre<_T> {
22
/// Creates a new copy of `TheListsPre` 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 = TheListsIndices::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 [`TheLists`] 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<TheLists> {
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> TheListsPre<_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<TheLists> {
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-lists`.
68
///
69
/// This is an implementation detail of [`TheListsPre`] and can
70
/// be constructed if needed as well.
71
///
72
/// For more information see [`TheLists`] as well.
73
#[derive(Clone)]
74
pub struct TheListsIndices {
75
interface0: exports::foo::foo::lists::GuestIndices,
76
}
77
/// Auto-generated bindings for an instance a component which
78
/// implements the world `the-lists`.
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
/// [`TheLists::instantiate`] which only needs a
85
/// [`Store`], [`Component`], and [`Linker`].
86
///
87
/// * Alternatively you can create a [`TheListsPre`] 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 [`TheListsPre::instantiate`] to
91
/// create a [`TheLists`].
92
///
93
/// * If you've instantiated the instance yourself already
94
/// then you can use [`TheLists::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 TheLists {
103
interface0: exports::foo::foo::lists::Guest,
104
}
105
const _: () = {
106
#[allow(unused_imports)]
107
use wasmtime::component::__internal::anyhow;
108
impl TheListsIndices {
109
/// Creates a new copy of `TheListsIndices` bindings which can then
110
/// be used to instantiate into a particular store.
111
///
112
/// This method may fail if the component does not have the
113
/// required exports.
114
pub fn new<_T>(
115
_instance_pre: &wasmtime::component::InstancePre<_T>,
116
) -> wasmtime::Result<Self> {
117
let _component = _instance_pre.component();
118
let _instance_type = _instance_pre.instance_type();
119
let interface0 = exports::foo::foo::lists::GuestIndices::new(_instance_pre)?;
120
Ok(TheListsIndices { interface0 })
121
}
122
/// Uses the indices stored in `self` to load an instance
123
/// of [`TheLists`] 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<TheLists> {
132
let _ = &mut store;
133
let _instance = instance;
134
let interface0 = self.interface0.load(&mut store, &_instance)?;
135
Ok(TheLists { interface0 })
136
}
137
}
138
impl TheLists {
139
/// Convenience wrapper around [`TheListsPre::new`] and
140
/// [`TheListsPre::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<TheLists> {
146
let pre = linker.instantiate_pre(component)?;
147
TheListsPre::new(pre)?.instantiate(store)
148
}
149
/// Convenience wrapper around [`TheListsIndices::new`] and
150
/// [`TheListsIndices::load`].
151
pub fn new(
152
mut store: impl wasmtime::AsContextMut,
153
instance: &wasmtime::component::Instance,
154
) -> wasmtime::Result<TheLists> {
155
let indices = TheListsIndices::new(&instance.instance_pre(&store))?;
156
indices.load(&mut store, instance)
157
}
158
/// Convenience wrapper around [`TheListsPre::new`] and
159
/// [`TheListsPre::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<TheLists>
165
where
166
_T: Send,
167
{
168
let pre = linker.instantiate_pre(component)?;
169
TheListsPre::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::lists::HostWithStore,
177
for<'a> D::Data<'a>: foo::foo::lists::Host,
178
T: 'static,
179
{
180
foo::foo::lists::add_to_linker::<T, D>(linker, host_getter)?;
181
Ok(())
182
}
183
pub fn foo_foo_lists(&self) -> &exports::foo::foo::lists::Guest {
184
&self.interface0
185
}
186
}
187
};
188
pub mod foo {
189
pub mod foo {
190
#[allow(clippy::all)]
191
pub mod lists {
192
#[allow(unused_imports)]
193
use wasmtime::component::__internal::{anyhow, 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 OtherRecord {
200
#[component(name = "a1")]
201
pub a1: u32,
202
#[component(name = "a2")]
203
pub a2: u64,
204
#[component(name = "a3")]
205
pub a3: i32,
206
#[component(name = "a4")]
207
pub a4: i64,
208
#[component(name = "b")]
209
pub b: wasmtime::component::__internal::String,
210
#[component(name = "c")]
211
pub c: wasmtime::component::__internal::Vec<u8>,
212
}
213
impl core::fmt::Debug for OtherRecord {
214
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
215
f.debug_struct("OtherRecord")
216
.field("a1", &self.a1)
217
.field("a2", &self.a2)
218
.field("a3", &self.a3)
219
.field("a4", &self.a4)
220
.field("b", &self.b)
221
.field("c", &self.c)
222
.finish()
223
}
224
}
225
const _: () = {
226
assert!(
227
48 == < OtherRecord as wasmtime::component::ComponentType >::SIZE32
228
);
229
assert!(
230
8 == < OtherRecord as wasmtime::component::ComponentType >::ALIGN32
231
);
232
};
233
#[derive(wasmtime::component::ComponentType)]
234
#[derive(wasmtime::component::Lift)]
235
#[derive(wasmtime::component::Lower)]
236
#[component(record)]
237
#[derive(Clone)]
238
pub struct SomeRecord {
239
#[component(name = "x")]
240
pub x: wasmtime::component::__internal::String,
241
#[component(name = "y")]
242
pub y: OtherRecord,
243
#[component(name = "z")]
244
pub z: wasmtime::component::__internal::Vec<OtherRecord>,
245
#[component(name = "c1")]
246
pub c1: u32,
247
#[component(name = "c2")]
248
pub c2: u64,
249
#[component(name = "c3")]
250
pub c3: i32,
251
#[component(name = "c4")]
252
pub c4: i64,
253
}
254
impl core::fmt::Debug for SomeRecord {
255
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
256
f.debug_struct("SomeRecord")
257
.field("x", &self.x)
258
.field("y", &self.y)
259
.field("z", &self.z)
260
.field("c1", &self.c1)
261
.field("c2", &self.c2)
262
.field("c3", &self.c3)
263
.field("c4", &self.c4)
264
.finish()
265
}
266
}
267
const _: () = {
268
assert!(
269
96 == < SomeRecord as wasmtime::component::ComponentType >::SIZE32
270
);
271
assert!(
272
8 == < SomeRecord as wasmtime::component::ComponentType >::ALIGN32
273
);
274
};
275
#[derive(wasmtime::component::ComponentType)]
276
#[derive(wasmtime::component::Lift)]
277
#[derive(wasmtime::component::Lower)]
278
#[component(variant)]
279
#[derive(Clone)]
280
pub enum OtherVariant {
281
#[component(name = "a")]
282
A,
283
#[component(name = "b")]
284
B(u32),
285
#[component(name = "c")]
286
C(wasmtime::component::__internal::String),
287
}
288
impl core::fmt::Debug for OtherVariant {
289
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
290
match self {
291
OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),
292
OtherVariant::B(e) => {
293
f.debug_tuple("OtherVariant::B").field(e).finish()
294
}
295
OtherVariant::C(e) => {
296
f.debug_tuple("OtherVariant::C").field(e).finish()
297
}
298
}
299
}
300
}
301
const _: () = {
302
assert!(
303
12 == < OtherVariant as wasmtime::component::ComponentType >::SIZE32
304
);
305
assert!(
306
4 == < OtherVariant as wasmtime::component::ComponentType >::ALIGN32
307
);
308
};
309
#[derive(wasmtime::component::ComponentType)]
310
#[derive(wasmtime::component::Lift)]
311
#[derive(wasmtime::component::Lower)]
312
#[component(variant)]
313
#[derive(Clone)]
314
pub enum SomeVariant {
315
#[component(name = "a")]
316
A(wasmtime::component::__internal::String),
317
#[component(name = "b")]
318
B,
319
#[component(name = "c")]
320
C(u32),
321
#[component(name = "d")]
322
D(wasmtime::component::__internal::Vec<OtherVariant>),
323
}
324
impl core::fmt::Debug for SomeVariant {
325
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
326
match self {
327
SomeVariant::A(e) => {
328
f.debug_tuple("SomeVariant::A").field(e).finish()
329
}
330
SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),
331
SomeVariant::C(e) => {
332
f.debug_tuple("SomeVariant::C").field(e).finish()
333
}
334
SomeVariant::D(e) => {
335
f.debug_tuple("SomeVariant::D").field(e).finish()
336
}
337
}
338
}
339
}
340
const _: () = {
341
assert!(
342
12 == < SomeVariant as wasmtime::component::ComponentType >::SIZE32
343
);
344
assert!(
345
4 == < SomeVariant as wasmtime::component::ComponentType >::ALIGN32
346
);
347
};
348
pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<
349
(
350
wasmtime::component::__internal::String,
351
u8,
352
i8,
353
u16,
354
i16,
355
u32,
356
i32,
357
u64,
358
i64,
359
f32,
360
f64,
361
char,
362
),
363
>;
364
const _: () = {
365
assert!(
366
8 == < LoadStoreAllSizes as wasmtime::component::ComponentType
367
>::SIZE32
368
);
369
assert!(
370
4 == < LoadStoreAllSizes as wasmtime::component::ComponentType
371
>::ALIGN32
372
);
373
};
374
pub trait HostWithStore: wasmtime::component::HasData {}
375
impl<_T: ?Sized> HostWithStore for _T
376
where
377
_T: wasmtime::component::HasData,
378
{}
379
pub trait Host {
380
fn list_u8_param(
381
&mut self,
382
x: wasmtime::component::__internal::Vec<u8>,
383
) -> ();
384
fn list_u16_param(
385
&mut self,
386
x: wasmtime::component::__internal::Vec<u16>,
387
) -> ();
388
fn list_u32_param(
389
&mut self,
390
x: wasmtime::component::__internal::Vec<u32>,
391
) -> ();
392
fn list_u64_param(
393
&mut self,
394
x: wasmtime::component::__internal::Vec<u64>,
395
) -> ();
396
fn list_s8_param(
397
&mut self,
398
x: wasmtime::component::__internal::Vec<i8>,
399
) -> ();
400
fn list_s16_param(
401
&mut self,
402
x: wasmtime::component::__internal::Vec<i16>,
403
) -> ();
404
fn list_s32_param(
405
&mut self,
406
x: wasmtime::component::__internal::Vec<i32>,
407
) -> ();
408
fn list_s64_param(
409
&mut self,
410
x: wasmtime::component::__internal::Vec<i64>,
411
) -> ();
412
fn list_f32_param(
413
&mut self,
414
x: wasmtime::component::__internal::Vec<f32>,
415
) -> ();
416
fn list_f64_param(
417
&mut self,
418
x: wasmtime::component::__internal::Vec<f64>,
419
) -> ();
420
fn list_u8_ret(&mut self) -> wasmtime::component::__internal::Vec<u8>;
421
fn list_u16_ret(&mut self) -> wasmtime::component::__internal::Vec<u16>;
422
fn list_u32_ret(&mut self) -> wasmtime::component::__internal::Vec<u32>;
423
fn list_u64_ret(&mut self) -> wasmtime::component::__internal::Vec<u64>;
424
fn list_s8_ret(&mut self) -> wasmtime::component::__internal::Vec<i8>;
425
fn list_s16_ret(&mut self) -> wasmtime::component::__internal::Vec<i16>;
426
fn list_s32_ret(&mut self) -> wasmtime::component::__internal::Vec<i32>;
427
fn list_s64_ret(&mut self) -> wasmtime::component::__internal::Vec<i64>;
428
fn list_f32_ret(&mut self) -> wasmtime::component::__internal::Vec<f32>;
429
fn list_f64_ret(&mut self) -> wasmtime::component::__internal::Vec<f64>;
430
fn tuple_list(
431
&mut self,
432
x: wasmtime::component::__internal::Vec<(u8, i8)>,
433
) -> wasmtime::component::__internal::Vec<(i64, u32)>;
434
fn string_list_arg(
435
&mut self,
436
a: wasmtime::component::__internal::Vec<
437
wasmtime::component::__internal::String,
438
>,
439
) -> ();
440
fn string_list_ret(
441
&mut self,
442
) -> wasmtime::component::__internal::Vec<
443
wasmtime::component::__internal::String,
444
>;
445
fn tuple_string_list(
446
&mut self,
447
x: wasmtime::component::__internal::Vec<
448
(u8, wasmtime::component::__internal::String),
449
>,
450
) -> wasmtime::component::__internal::Vec<
451
(wasmtime::component::__internal::String, u8),
452
>;
453
fn string_list(
454
&mut self,
455
x: wasmtime::component::__internal::Vec<
456
wasmtime::component::__internal::String,
457
>,
458
) -> wasmtime::component::__internal::Vec<
459
wasmtime::component::__internal::String,
460
>;
461
fn record_list(
462
&mut self,
463
x: wasmtime::component::__internal::Vec<SomeRecord>,
464
) -> wasmtime::component::__internal::Vec<OtherRecord>;
465
fn record_list_reverse(
466
&mut self,
467
x: wasmtime::component::__internal::Vec<OtherRecord>,
468
) -> wasmtime::component::__internal::Vec<SomeRecord>;
469
fn variant_list(
470
&mut self,
471
x: wasmtime::component::__internal::Vec<SomeVariant>,
472
) -> wasmtime::component::__internal::Vec<OtherVariant>;
473
fn load_store_everything(
474
&mut self,
475
a: LoadStoreAllSizes,
476
) -> LoadStoreAllSizes;
477
}
478
impl<_T: Host + ?Sized> Host for &mut _T {
479
fn list_u8_param(
480
&mut self,
481
x: wasmtime::component::__internal::Vec<u8>,
482
) -> () {
483
Host::list_u8_param(*self, x)
484
}
485
fn list_u16_param(
486
&mut self,
487
x: wasmtime::component::__internal::Vec<u16>,
488
) -> () {
489
Host::list_u16_param(*self, x)
490
}
491
fn list_u32_param(
492
&mut self,
493
x: wasmtime::component::__internal::Vec<u32>,
494
) -> () {
495
Host::list_u32_param(*self, x)
496
}
497
fn list_u64_param(
498
&mut self,
499
x: wasmtime::component::__internal::Vec<u64>,
500
) -> () {
501
Host::list_u64_param(*self, x)
502
}
503
fn list_s8_param(
504
&mut self,
505
x: wasmtime::component::__internal::Vec<i8>,
506
) -> () {
507
Host::list_s8_param(*self, x)
508
}
509
fn list_s16_param(
510
&mut self,
511
x: wasmtime::component::__internal::Vec<i16>,
512
) -> () {
513
Host::list_s16_param(*self, x)
514
}
515
fn list_s32_param(
516
&mut self,
517
x: wasmtime::component::__internal::Vec<i32>,
518
) -> () {
519
Host::list_s32_param(*self, x)
520
}
521
fn list_s64_param(
522
&mut self,
523
x: wasmtime::component::__internal::Vec<i64>,
524
) -> () {
525
Host::list_s64_param(*self, x)
526
}
527
fn list_f32_param(
528
&mut self,
529
x: wasmtime::component::__internal::Vec<f32>,
530
) -> () {
531
Host::list_f32_param(*self, x)
532
}
533
fn list_f64_param(
534
&mut self,
535
x: wasmtime::component::__internal::Vec<f64>,
536
) -> () {
537
Host::list_f64_param(*self, x)
538
}
539
fn list_u8_ret(&mut self) -> wasmtime::component::__internal::Vec<u8> {
540
Host::list_u8_ret(*self)
541
}
542
fn list_u16_ret(&mut self) -> wasmtime::component::__internal::Vec<u16> {
543
Host::list_u16_ret(*self)
544
}
545
fn list_u32_ret(&mut self) -> wasmtime::component::__internal::Vec<u32> {
546
Host::list_u32_ret(*self)
547
}
548
fn list_u64_ret(&mut self) -> wasmtime::component::__internal::Vec<u64> {
549
Host::list_u64_ret(*self)
550
}
551
fn list_s8_ret(&mut self) -> wasmtime::component::__internal::Vec<i8> {
552
Host::list_s8_ret(*self)
553
}
554
fn list_s16_ret(&mut self) -> wasmtime::component::__internal::Vec<i16> {
555
Host::list_s16_ret(*self)
556
}
557
fn list_s32_ret(&mut self) -> wasmtime::component::__internal::Vec<i32> {
558
Host::list_s32_ret(*self)
559
}
560
fn list_s64_ret(&mut self) -> wasmtime::component::__internal::Vec<i64> {
561
Host::list_s64_ret(*self)
562
}
563
fn list_f32_ret(&mut self) -> wasmtime::component::__internal::Vec<f32> {
564
Host::list_f32_ret(*self)
565
}
566
fn list_f64_ret(&mut self) -> wasmtime::component::__internal::Vec<f64> {
567
Host::list_f64_ret(*self)
568
}
569
fn tuple_list(
570
&mut self,
571
x: wasmtime::component::__internal::Vec<(u8, i8)>,
572
) -> wasmtime::component::__internal::Vec<(i64, u32)> {
573
Host::tuple_list(*self, x)
574
}
575
fn string_list_arg(
576
&mut self,
577
a: wasmtime::component::__internal::Vec<
578
wasmtime::component::__internal::String,
579
>,
580
) -> () {
581
Host::string_list_arg(*self, a)
582
}
583
fn string_list_ret(
584
&mut self,
585
) -> wasmtime::component::__internal::Vec<
586
wasmtime::component::__internal::String,
587
> {
588
Host::string_list_ret(*self)
589
}
590
fn tuple_string_list(
591
&mut self,
592
x: wasmtime::component::__internal::Vec<
593
(u8, wasmtime::component::__internal::String),
594
>,
595
) -> wasmtime::component::__internal::Vec<
596
(wasmtime::component::__internal::String, u8),
597
> {
598
Host::tuple_string_list(*self, x)
599
}
600
fn string_list(
601
&mut self,
602
x: wasmtime::component::__internal::Vec<
603
wasmtime::component::__internal::String,
604
>,
605
) -> wasmtime::component::__internal::Vec<
606
wasmtime::component::__internal::String,
607
> {
608
Host::string_list(*self, x)
609
}
610
fn record_list(
611
&mut self,
612
x: wasmtime::component::__internal::Vec<SomeRecord>,
613
) -> wasmtime::component::__internal::Vec<OtherRecord> {
614
Host::record_list(*self, x)
615
}
616
fn record_list_reverse(
617
&mut self,
618
x: wasmtime::component::__internal::Vec<OtherRecord>,
619
) -> wasmtime::component::__internal::Vec<SomeRecord> {
620
Host::record_list_reverse(*self, x)
621
}
622
fn variant_list(
623
&mut self,
624
x: wasmtime::component::__internal::Vec<SomeVariant>,
625
) -> wasmtime::component::__internal::Vec<OtherVariant> {
626
Host::variant_list(*self, x)
627
}
628
fn load_store_everything(
629
&mut self,
630
a: LoadStoreAllSizes,
631
) -> LoadStoreAllSizes {
632
Host::load_store_everything(*self, a)
633
}
634
}
635
pub fn add_to_linker<T, D>(
636
linker: &mut wasmtime::component::Linker<T>,
637
host_getter: fn(&mut T) -> D::Data<'_>,
638
) -> wasmtime::Result<()>
639
where
640
D: HostWithStore,
641
for<'a> D::Data<'a>: Host,
642
T: 'static,
643
{
644
let mut inst = linker.instance("foo:foo/lists")?;
645
inst.func_wrap(
646
"list-u8-param",
647
move |
648
mut caller: wasmtime::StoreContextMut<'_, T>,
649
(arg0,): (wasmtime::component::__internal::Vec<u8>,)|
650
{
651
let host = &mut host_getter(caller.data_mut());
652
let r = Host::list_u8_param(host, arg0);
653
Ok(r)
654
},
655
)?;
656
inst.func_wrap(
657
"list-u16-param",
658
move |
659
mut caller: wasmtime::StoreContextMut<'_, T>,
660
(arg0,): (wasmtime::component::__internal::Vec<u16>,)|
661
{
662
let host = &mut host_getter(caller.data_mut());
663
let r = Host::list_u16_param(host, arg0);
664
Ok(r)
665
},
666
)?;
667
inst.func_wrap(
668
"list-u32-param",
669
move |
670
mut caller: wasmtime::StoreContextMut<'_, T>,
671
(arg0,): (wasmtime::component::__internal::Vec<u32>,)|
672
{
673
let host = &mut host_getter(caller.data_mut());
674
let r = Host::list_u32_param(host, arg0);
675
Ok(r)
676
},
677
)?;
678
inst.func_wrap(
679
"list-u64-param",
680
move |
681
mut caller: wasmtime::StoreContextMut<'_, T>,
682
(arg0,): (wasmtime::component::__internal::Vec<u64>,)|
683
{
684
let host = &mut host_getter(caller.data_mut());
685
let r = Host::list_u64_param(host, arg0);
686
Ok(r)
687
},
688
)?;
689
inst.func_wrap(
690
"list-s8-param",
691
move |
692
mut caller: wasmtime::StoreContextMut<'_, T>,
693
(arg0,): (wasmtime::component::__internal::Vec<i8>,)|
694
{
695
let host = &mut host_getter(caller.data_mut());
696
let r = Host::list_s8_param(host, arg0);
697
Ok(r)
698
},
699
)?;
700
inst.func_wrap(
701
"list-s16-param",
702
move |
703
mut caller: wasmtime::StoreContextMut<'_, T>,
704
(arg0,): (wasmtime::component::__internal::Vec<i16>,)|
705
{
706
let host = &mut host_getter(caller.data_mut());
707
let r = Host::list_s16_param(host, arg0);
708
Ok(r)
709
},
710
)?;
711
inst.func_wrap(
712
"list-s32-param",
713
move |
714
mut caller: wasmtime::StoreContextMut<'_, T>,
715
(arg0,): (wasmtime::component::__internal::Vec<i32>,)|
716
{
717
let host = &mut host_getter(caller.data_mut());
718
let r = Host::list_s32_param(host, arg0);
719
Ok(r)
720
},
721
)?;
722
inst.func_wrap(
723
"list-s64-param",
724
move |
725
mut caller: wasmtime::StoreContextMut<'_, T>,
726
(arg0,): (wasmtime::component::__internal::Vec<i64>,)|
727
{
728
let host = &mut host_getter(caller.data_mut());
729
let r = Host::list_s64_param(host, arg0);
730
Ok(r)
731
},
732
)?;
733
inst.func_wrap(
734
"list-f32-param",
735
move |
736
mut caller: wasmtime::StoreContextMut<'_, T>,
737
(arg0,): (wasmtime::component::__internal::Vec<f32>,)|
738
{
739
let host = &mut host_getter(caller.data_mut());
740
let r = Host::list_f32_param(host, arg0);
741
Ok(r)
742
},
743
)?;
744
inst.func_wrap(
745
"list-f64-param",
746
move |
747
mut caller: wasmtime::StoreContextMut<'_, T>,
748
(arg0,): (wasmtime::component::__internal::Vec<f64>,)|
749
{
750
let host = &mut host_getter(caller.data_mut());
751
let r = Host::list_f64_param(host, arg0);
752
Ok(r)
753
},
754
)?;
755
inst.func_wrap(
756
"list-u8-ret",
757
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
758
let host = &mut host_getter(caller.data_mut());
759
let r = Host::list_u8_ret(host);
760
Ok((r,))
761
},
762
)?;
763
inst.func_wrap(
764
"list-u16-ret",
765
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
766
let host = &mut host_getter(caller.data_mut());
767
let r = Host::list_u16_ret(host);
768
Ok((r,))
769
},
770
)?;
771
inst.func_wrap(
772
"list-u32-ret",
773
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
774
let host = &mut host_getter(caller.data_mut());
775
let r = Host::list_u32_ret(host);
776
Ok((r,))
777
},
778
)?;
779
inst.func_wrap(
780
"list-u64-ret",
781
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
782
let host = &mut host_getter(caller.data_mut());
783
let r = Host::list_u64_ret(host);
784
Ok((r,))
785
},
786
)?;
787
inst.func_wrap(
788
"list-s8-ret",
789
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
790
let host = &mut host_getter(caller.data_mut());
791
let r = Host::list_s8_ret(host);
792
Ok((r,))
793
},
794
)?;
795
inst.func_wrap(
796
"list-s16-ret",
797
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
798
let host = &mut host_getter(caller.data_mut());
799
let r = Host::list_s16_ret(host);
800
Ok((r,))
801
},
802
)?;
803
inst.func_wrap(
804
"list-s32-ret",
805
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
806
let host = &mut host_getter(caller.data_mut());
807
let r = Host::list_s32_ret(host);
808
Ok((r,))
809
},
810
)?;
811
inst.func_wrap(
812
"list-s64-ret",
813
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
814
let host = &mut host_getter(caller.data_mut());
815
let r = Host::list_s64_ret(host);
816
Ok((r,))
817
},
818
)?;
819
inst.func_wrap(
820
"list-f32-ret",
821
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
822
let host = &mut host_getter(caller.data_mut());
823
let r = Host::list_f32_ret(host);
824
Ok((r,))
825
},
826
)?;
827
inst.func_wrap(
828
"list-f64-ret",
829
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
830
let host = &mut host_getter(caller.data_mut());
831
let r = Host::list_f64_ret(host);
832
Ok((r,))
833
},
834
)?;
835
inst.func_wrap(
836
"tuple-list",
837
move |
838
mut caller: wasmtime::StoreContextMut<'_, T>,
839
(arg0,): (wasmtime::component::__internal::Vec<(u8, i8)>,)|
840
{
841
let host = &mut host_getter(caller.data_mut());
842
let r = Host::tuple_list(host, arg0);
843
Ok((r,))
844
},
845
)?;
846
inst.func_wrap(
847
"string-list-arg",
848
move |
849
mut caller: wasmtime::StoreContextMut<'_, T>,
850
(
851
arg0,
852
): (
853
wasmtime::component::__internal::Vec<
854
wasmtime::component::__internal::String,
855
>,
856
)|
857
{
858
let host = &mut host_getter(caller.data_mut());
859
let r = Host::string_list_arg(host, arg0);
860
Ok(r)
861
},
862
)?;
863
inst.func_wrap(
864
"string-list-ret",
865
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
866
let host = &mut host_getter(caller.data_mut());
867
let r = Host::string_list_ret(host);
868
Ok((r,))
869
},
870
)?;
871
inst.func_wrap(
872
"tuple-string-list",
873
move |
874
mut caller: wasmtime::StoreContextMut<'_, T>,
875
(
876
arg0,
877
): (
878
wasmtime::component::__internal::Vec<
879
(u8, wasmtime::component::__internal::String),
880
>,
881
)|
882
{
883
let host = &mut host_getter(caller.data_mut());
884
let r = Host::tuple_string_list(host, arg0);
885
Ok((r,))
886
},
887
)?;
888
inst.func_wrap(
889
"string-list",
890
move |
891
mut caller: wasmtime::StoreContextMut<'_, T>,
892
(
893
arg0,
894
): (
895
wasmtime::component::__internal::Vec<
896
wasmtime::component::__internal::String,
897
>,
898
)|
899
{
900
let host = &mut host_getter(caller.data_mut());
901
let r = Host::string_list(host, arg0);
902
Ok((r,))
903
},
904
)?;
905
inst.func_wrap(
906
"record-list",
907
move |
908
mut caller: wasmtime::StoreContextMut<'_, T>,
909
(arg0,): (wasmtime::component::__internal::Vec<SomeRecord>,)|
910
{
911
let host = &mut host_getter(caller.data_mut());
912
let r = Host::record_list(host, arg0);
913
Ok((r,))
914
},
915
)?;
916
inst.func_wrap(
917
"record-list-reverse",
918
move |
919
mut caller: wasmtime::StoreContextMut<'_, T>,
920
(arg0,): (wasmtime::component::__internal::Vec<OtherRecord>,)|
921
{
922
let host = &mut host_getter(caller.data_mut());
923
let r = Host::record_list_reverse(host, arg0);
924
Ok((r,))
925
},
926
)?;
927
inst.func_wrap(
928
"variant-list",
929
move |
930
mut caller: wasmtime::StoreContextMut<'_, T>,
931
(arg0,): (wasmtime::component::__internal::Vec<SomeVariant>,)|
932
{
933
let host = &mut host_getter(caller.data_mut());
934
let r = Host::variant_list(host, arg0);
935
Ok((r,))
936
},
937
)?;
938
inst.func_wrap(
939
"load-store-everything",
940
move |
941
mut caller: wasmtime::StoreContextMut<'_, T>,
942
(arg0,): (LoadStoreAllSizes,)|
943
{
944
let host = &mut host_getter(caller.data_mut());
945
let r = Host::load_store_everything(host, arg0);
946
Ok((r,))
947
},
948
)?;
949
Ok(())
950
}
951
}
952
}
953
}
954
pub mod exports {
955
pub mod foo {
956
pub mod foo {
957
#[allow(clippy::all)]
958
pub mod lists {
959
#[allow(unused_imports)]
960
use wasmtime::component::__internal::{anyhow, Box};
961
#[derive(wasmtime::component::ComponentType)]
962
#[derive(wasmtime::component::Lift)]
963
#[derive(wasmtime::component::Lower)]
964
#[component(record)]
965
#[derive(Clone)]
966
pub struct OtherRecord {
967
#[component(name = "a1")]
968
pub a1: u32,
969
#[component(name = "a2")]
970
pub a2: u64,
971
#[component(name = "a3")]
972
pub a3: i32,
973
#[component(name = "a4")]
974
pub a4: i64,
975
#[component(name = "b")]
976
pub b: wasmtime::component::__internal::String,
977
#[component(name = "c")]
978
pub c: wasmtime::component::__internal::Vec<u8>,
979
}
980
impl core::fmt::Debug for OtherRecord {
981
fn fmt(
982
&self,
983
f: &mut core::fmt::Formatter<'_>,
984
) -> core::fmt::Result {
985
f.debug_struct("OtherRecord")
986
.field("a1", &self.a1)
987
.field("a2", &self.a2)
988
.field("a3", &self.a3)
989
.field("a4", &self.a4)
990
.field("b", &self.b)
991
.field("c", &self.c)
992
.finish()
993
}
994
}
995
const _: () = {
996
assert!(
997
48 == < OtherRecord as wasmtime::component::ComponentType
998
>::SIZE32
999
);
1000
assert!(
1001
8 == < OtherRecord as wasmtime::component::ComponentType
1002
>::ALIGN32
1003
);
1004
};
1005
#[derive(wasmtime::component::ComponentType)]
1006
#[derive(wasmtime::component::Lift)]
1007
#[derive(wasmtime::component::Lower)]
1008
#[component(record)]
1009
#[derive(Clone)]
1010
pub struct SomeRecord {
1011
#[component(name = "x")]
1012
pub x: wasmtime::component::__internal::String,
1013
#[component(name = "y")]
1014
pub y: OtherRecord,
1015
#[component(name = "z")]
1016
pub z: wasmtime::component::__internal::Vec<OtherRecord>,
1017
#[component(name = "c1")]
1018
pub c1: u32,
1019
#[component(name = "c2")]
1020
pub c2: u64,
1021
#[component(name = "c3")]
1022
pub c3: i32,
1023
#[component(name = "c4")]
1024
pub c4: i64,
1025
}
1026
impl core::fmt::Debug for SomeRecord {
1027
fn fmt(
1028
&self,
1029
f: &mut core::fmt::Formatter<'_>,
1030
) -> core::fmt::Result {
1031
f.debug_struct("SomeRecord")
1032
.field("x", &self.x)
1033
.field("y", &self.y)
1034
.field("z", &self.z)
1035
.field("c1", &self.c1)
1036
.field("c2", &self.c2)
1037
.field("c3", &self.c3)
1038
.field("c4", &self.c4)
1039
.finish()
1040
}
1041
}
1042
const _: () = {
1043
assert!(
1044
96 == < SomeRecord as wasmtime::component::ComponentType
1045
>::SIZE32
1046
);
1047
assert!(
1048
8 == < SomeRecord as wasmtime::component::ComponentType
1049
>::ALIGN32
1050
);
1051
};
1052
#[derive(wasmtime::component::ComponentType)]
1053
#[derive(wasmtime::component::Lift)]
1054
#[derive(wasmtime::component::Lower)]
1055
#[component(variant)]
1056
#[derive(Clone)]
1057
pub enum OtherVariant {
1058
#[component(name = "a")]
1059
A,
1060
#[component(name = "b")]
1061
B(u32),
1062
#[component(name = "c")]
1063
C(wasmtime::component::__internal::String),
1064
}
1065
impl core::fmt::Debug for OtherVariant {
1066
fn fmt(
1067
&self,
1068
f: &mut core::fmt::Formatter<'_>,
1069
) -> core::fmt::Result {
1070
match self {
1071
OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),
1072
OtherVariant::B(e) => {
1073
f.debug_tuple("OtherVariant::B").field(e).finish()
1074
}
1075
OtherVariant::C(e) => {
1076
f.debug_tuple("OtherVariant::C").field(e).finish()
1077
}
1078
}
1079
}
1080
}
1081
const _: () = {
1082
assert!(
1083
12 == < OtherVariant as wasmtime::component::ComponentType
1084
>::SIZE32
1085
);
1086
assert!(
1087
4 == < OtherVariant as wasmtime::component::ComponentType
1088
>::ALIGN32
1089
);
1090
};
1091
#[derive(wasmtime::component::ComponentType)]
1092
#[derive(wasmtime::component::Lift)]
1093
#[derive(wasmtime::component::Lower)]
1094
#[component(variant)]
1095
#[derive(Clone)]
1096
pub enum SomeVariant {
1097
#[component(name = "a")]
1098
A(wasmtime::component::__internal::String),
1099
#[component(name = "b")]
1100
B,
1101
#[component(name = "c")]
1102
C(u32),
1103
#[component(name = "d")]
1104
D(wasmtime::component::__internal::Vec<OtherVariant>),
1105
}
1106
impl core::fmt::Debug for SomeVariant {
1107
fn fmt(
1108
&self,
1109
f: &mut core::fmt::Formatter<'_>,
1110
) -> core::fmt::Result {
1111
match self {
1112
SomeVariant::A(e) => {
1113
f.debug_tuple("SomeVariant::A").field(e).finish()
1114
}
1115
SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),
1116
SomeVariant::C(e) => {
1117
f.debug_tuple("SomeVariant::C").field(e).finish()
1118
}
1119
SomeVariant::D(e) => {
1120
f.debug_tuple("SomeVariant::D").field(e).finish()
1121
}
1122
}
1123
}
1124
}
1125
const _: () = {
1126
assert!(
1127
12 == < SomeVariant as wasmtime::component::ComponentType
1128
>::SIZE32
1129
);
1130
assert!(
1131
4 == < SomeVariant as wasmtime::component::ComponentType
1132
>::ALIGN32
1133
);
1134
};
1135
pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<
1136
(
1137
wasmtime::component::__internal::String,
1138
u8,
1139
i8,
1140
u16,
1141
i16,
1142
u32,
1143
i32,
1144
u64,
1145
i64,
1146
f32,
1147
f64,
1148
char,
1149
),
1150
>;
1151
const _: () = {
1152
assert!(
1153
8 == < LoadStoreAllSizes as wasmtime::component::ComponentType
1154
>::SIZE32
1155
);
1156
assert!(
1157
4 == < LoadStoreAllSizes as wasmtime::component::ComponentType
1158
>::ALIGN32
1159
);
1160
};
1161
pub struct Guest {
1162
list_u8_param: wasmtime::component::Func,
1163
list_u16_param: wasmtime::component::Func,
1164
list_u32_param: wasmtime::component::Func,
1165
list_u64_param: wasmtime::component::Func,
1166
list_s8_param: wasmtime::component::Func,
1167
list_s16_param: wasmtime::component::Func,
1168
list_s32_param: wasmtime::component::Func,
1169
list_s64_param: wasmtime::component::Func,
1170
list_f32_param: wasmtime::component::Func,
1171
list_f64_param: wasmtime::component::Func,
1172
list_u8_ret: wasmtime::component::Func,
1173
list_u16_ret: wasmtime::component::Func,
1174
list_u32_ret: wasmtime::component::Func,
1175
list_u64_ret: wasmtime::component::Func,
1176
list_s8_ret: wasmtime::component::Func,
1177
list_s16_ret: wasmtime::component::Func,
1178
list_s32_ret: wasmtime::component::Func,
1179
list_s64_ret: wasmtime::component::Func,
1180
list_f32_ret: wasmtime::component::Func,
1181
list_f64_ret: wasmtime::component::Func,
1182
tuple_list: wasmtime::component::Func,
1183
string_list_arg: wasmtime::component::Func,
1184
string_list_ret: wasmtime::component::Func,
1185
tuple_string_list: wasmtime::component::Func,
1186
string_list: wasmtime::component::Func,
1187
record_list: wasmtime::component::Func,
1188
record_list_reverse: wasmtime::component::Func,
1189
variant_list: wasmtime::component::Func,
1190
load_store_everything: wasmtime::component::Func,
1191
}
1192
#[derive(Clone)]
1193
pub struct GuestIndices {
1194
list_u8_param: wasmtime::component::ComponentExportIndex,
1195
list_u16_param: wasmtime::component::ComponentExportIndex,
1196
list_u32_param: wasmtime::component::ComponentExportIndex,
1197
list_u64_param: wasmtime::component::ComponentExportIndex,
1198
list_s8_param: wasmtime::component::ComponentExportIndex,
1199
list_s16_param: wasmtime::component::ComponentExportIndex,
1200
list_s32_param: wasmtime::component::ComponentExportIndex,
1201
list_s64_param: wasmtime::component::ComponentExportIndex,
1202
list_f32_param: wasmtime::component::ComponentExportIndex,
1203
list_f64_param: wasmtime::component::ComponentExportIndex,
1204
list_u8_ret: wasmtime::component::ComponentExportIndex,
1205
list_u16_ret: wasmtime::component::ComponentExportIndex,
1206
list_u32_ret: wasmtime::component::ComponentExportIndex,
1207
list_u64_ret: wasmtime::component::ComponentExportIndex,
1208
list_s8_ret: wasmtime::component::ComponentExportIndex,
1209
list_s16_ret: wasmtime::component::ComponentExportIndex,
1210
list_s32_ret: wasmtime::component::ComponentExportIndex,
1211
list_s64_ret: wasmtime::component::ComponentExportIndex,
1212
list_f32_ret: wasmtime::component::ComponentExportIndex,
1213
list_f64_ret: wasmtime::component::ComponentExportIndex,
1214
tuple_list: wasmtime::component::ComponentExportIndex,
1215
string_list_arg: wasmtime::component::ComponentExportIndex,
1216
string_list_ret: wasmtime::component::ComponentExportIndex,
1217
tuple_string_list: wasmtime::component::ComponentExportIndex,
1218
string_list: wasmtime::component::ComponentExportIndex,
1219
record_list: wasmtime::component::ComponentExportIndex,
1220
record_list_reverse: wasmtime::component::ComponentExportIndex,
1221
variant_list: wasmtime::component::ComponentExportIndex,
1222
load_store_everything: wasmtime::component::ComponentExportIndex,
1223
}
1224
impl GuestIndices {
1225
/// Constructor for [`GuestIndices`] which takes a
1226
/// [`Component`](wasmtime::component::Component) as input and can be executed
1227
/// before instantiation.
1228
///
1229
/// This constructor can be used to front-load string lookups to find exports
1230
/// within a component.
1231
pub fn new<_T>(
1232
_instance_pre: &wasmtime::component::InstancePre<_T>,
1233
) -> wasmtime::Result<GuestIndices> {
1234
let instance = _instance_pre
1235
.component()
1236
.get_export_index(None, "foo:foo/lists")
1237
.ok_or_else(|| {
1238
anyhow::anyhow!(
1239
"no exported instance named `foo:foo/lists`"
1240
)
1241
})?;
1242
let mut lookup = move |name| {
1243
_instance_pre
1244
.component()
1245
.get_export_index(Some(&instance), name)
1246
.ok_or_else(|| {
1247
anyhow::anyhow!(
1248
"instance export `foo:foo/lists` does \
1249
not have export `{name}`"
1250
)
1251
})
1252
};
1253
let _ = &mut lookup;
1254
let list_u8_param = lookup("list-u8-param")?;
1255
let list_u16_param = lookup("list-u16-param")?;
1256
let list_u32_param = lookup("list-u32-param")?;
1257
let list_u64_param = lookup("list-u64-param")?;
1258
let list_s8_param = lookup("list-s8-param")?;
1259
let list_s16_param = lookup("list-s16-param")?;
1260
let list_s32_param = lookup("list-s32-param")?;
1261
let list_s64_param = lookup("list-s64-param")?;
1262
let list_f32_param = lookup("list-f32-param")?;
1263
let list_f64_param = lookup("list-f64-param")?;
1264
let list_u8_ret = lookup("list-u8-ret")?;
1265
let list_u16_ret = lookup("list-u16-ret")?;
1266
let list_u32_ret = lookup("list-u32-ret")?;
1267
let list_u64_ret = lookup("list-u64-ret")?;
1268
let list_s8_ret = lookup("list-s8-ret")?;
1269
let list_s16_ret = lookup("list-s16-ret")?;
1270
let list_s32_ret = lookup("list-s32-ret")?;
1271
let list_s64_ret = lookup("list-s64-ret")?;
1272
let list_f32_ret = lookup("list-f32-ret")?;
1273
let list_f64_ret = lookup("list-f64-ret")?;
1274
let tuple_list = lookup("tuple-list")?;
1275
let string_list_arg = lookup("string-list-arg")?;
1276
let string_list_ret = lookup("string-list-ret")?;
1277
let tuple_string_list = lookup("tuple-string-list")?;
1278
let string_list = lookup("string-list")?;
1279
let record_list = lookup("record-list")?;
1280
let record_list_reverse = lookup("record-list-reverse")?;
1281
let variant_list = lookup("variant-list")?;
1282
let load_store_everything = lookup("load-store-everything")?;
1283
Ok(GuestIndices {
1284
list_u8_param,
1285
list_u16_param,
1286
list_u32_param,
1287
list_u64_param,
1288
list_s8_param,
1289
list_s16_param,
1290
list_s32_param,
1291
list_s64_param,
1292
list_f32_param,
1293
list_f64_param,
1294
list_u8_ret,
1295
list_u16_ret,
1296
list_u32_ret,
1297
list_u64_ret,
1298
list_s8_ret,
1299
list_s16_ret,
1300
list_s32_ret,
1301
list_s64_ret,
1302
list_f32_ret,
1303
list_f64_ret,
1304
tuple_list,
1305
string_list_arg,
1306
string_list_ret,
1307
tuple_string_list,
1308
string_list,
1309
record_list,
1310
record_list_reverse,
1311
variant_list,
1312
load_store_everything,
1313
})
1314
}
1315
pub fn load(
1316
&self,
1317
mut store: impl wasmtime::AsContextMut,
1318
instance: &wasmtime::component::Instance,
1319
) -> wasmtime::Result<Guest> {
1320
let _instance = instance;
1321
let _instance_pre = _instance.instance_pre(&store);
1322
let _instance_type = _instance_pre.instance_type();
1323
let mut store = store.as_context_mut();
1324
let _ = &mut store;
1325
let list_u8_param = *_instance
1326
.get_typed_func::<
1327
(&[u8],),
1328
(),
1329
>(&mut store, &self.list_u8_param)?
1330
.func();
1331
let list_u16_param = *_instance
1332
.get_typed_func::<
1333
(&[u16],),
1334
(),
1335
>(&mut store, &self.list_u16_param)?
1336
.func();
1337
let list_u32_param = *_instance
1338
.get_typed_func::<
1339
(&[u32],),
1340
(),
1341
>(&mut store, &self.list_u32_param)?
1342
.func();
1343
let list_u64_param = *_instance
1344
.get_typed_func::<
1345
(&[u64],),
1346
(),
1347
>(&mut store, &self.list_u64_param)?
1348
.func();
1349
let list_s8_param = *_instance
1350
.get_typed_func::<
1351
(&[i8],),
1352
(),
1353
>(&mut store, &self.list_s8_param)?
1354
.func();
1355
let list_s16_param = *_instance
1356
.get_typed_func::<
1357
(&[i16],),
1358
(),
1359
>(&mut store, &self.list_s16_param)?
1360
.func();
1361
let list_s32_param = *_instance
1362
.get_typed_func::<
1363
(&[i32],),
1364
(),
1365
>(&mut store, &self.list_s32_param)?
1366
.func();
1367
let list_s64_param = *_instance
1368
.get_typed_func::<
1369
(&[i64],),
1370
(),
1371
>(&mut store, &self.list_s64_param)?
1372
.func();
1373
let list_f32_param = *_instance
1374
.get_typed_func::<
1375
(&[f32],),
1376
(),
1377
>(&mut store, &self.list_f32_param)?
1378
.func();
1379
let list_f64_param = *_instance
1380
.get_typed_func::<
1381
(&[f64],),
1382
(),
1383
>(&mut store, &self.list_f64_param)?
1384
.func();
1385
let list_u8_ret = *_instance
1386
.get_typed_func::<
1387
(),
1388
(wasmtime::component::__internal::Vec<u8>,),
1389
>(&mut store, &self.list_u8_ret)?
1390
.func();
1391
let list_u16_ret = *_instance
1392
.get_typed_func::<
1393
(),
1394
(wasmtime::component::__internal::Vec<u16>,),
1395
>(&mut store, &self.list_u16_ret)?
1396
.func();
1397
let list_u32_ret = *_instance
1398
.get_typed_func::<
1399
(),
1400
(wasmtime::component::__internal::Vec<u32>,),
1401
>(&mut store, &self.list_u32_ret)?
1402
.func();
1403
let list_u64_ret = *_instance
1404
.get_typed_func::<
1405
(),
1406
(wasmtime::component::__internal::Vec<u64>,),
1407
>(&mut store, &self.list_u64_ret)?
1408
.func();
1409
let list_s8_ret = *_instance
1410
.get_typed_func::<
1411
(),
1412
(wasmtime::component::__internal::Vec<i8>,),
1413
>(&mut store, &self.list_s8_ret)?
1414
.func();
1415
let list_s16_ret = *_instance
1416
.get_typed_func::<
1417
(),
1418
(wasmtime::component::__internal::Vec<i16>,),
1419
>(&mut store, &self.list_s16_ret)?
1420
.func();
1421
let list_s32_ret = *_instance
1422
.get_typed_func::<
1423
(),
1424
(wasmtime::component::__internal::Vec<i32>,),
1425
>(&mut store, &self.list_s32_ret)?
1426
.func();
1427
let list_s64_ret = *_instance
1428
.get_typed_func::<
1429
(),
1430
(wasmtime::component::__internal::Vec<i64>,),
1431
>(&mut store, &self.list_s64_ret)?
1432
.func();
1433
let list_f32_ret = *_instance
1434
.get_typed_func::<
1435
(),
1436
(wasmtime::component::__internal::Vec<f32>,),
1437
>(&mut store, &self.list_f32_ret)?
1438
.func();
1439
let list_f64_ret = *_instance
1440
.get_typed_func::<
1441
(),
1442
(wasmtime::component::__internal::Vec<f64>,),
1443
>(&mut store, &self.list_f64_ret)?
1444
.func();
1445
let tuple_list = *_instance
1446
.get_typed_func::<
1447
(&[(u8, i8)],),
1448
(wasmtime::component::__internal::Vec<(i64, u32)>,),
1449
>(&mut store, &self.tuple_list)?
1450
.func();
1451
let string_list_arg = *_instance
1452
.get_typed_func::<
1453
(&[wasmtime::component::__internal::String],),
1454
(),
1455
>(&mut store, &self.string_list_arg)?
1456
.func();
1457
let string_list_ret = *_instance
1458
.get_typed_func::<
1459
(),
1460
(
1461
wasmtime::component::__internal::Vec<
1462
wasmtime::component::__internal::String,
1463
>,
1464
),
1465
>(&mut store, &self.string_list_ret)?
1466
.func();
1467
let tuple_string_list = *_instance
1468
.get_typed_func::<
1469
(&[(u8, wasmtime::component::__internal::String)],),
1470
(
1471
wasmtime::component::__internal::Vec<
1472
(wasmtime::component::__internal::String, u8),
1473
>,
1474
),
1475
>(&mut store, &self.tuple_string_list)?
1476
.func();
1477
let string_list = *_instance
1478
.get_typed_func::<
1479
(&[wasmtime::component::__internal::String],),
1480
(
1481
wasmtime::component::__internal::Vec<
1482
wasmtime::component::__internal::String,
1483
>,
1484
),
1485
>(&mut store, &self.string_list)?
1486
.func();
1487
let record_list = *_instance
1488
.get_typed_func::<
1489
(&[SomeRecord],),
1490
(wasmtime::component::__internal::Vec<OtherRecord>,),
1491
>(&mut store, &self.record_list)?
1492
.func();
1493
let record_list_reverse = *_instance
1494
.get_typed_func::<
1495
(&[OtherRecord],),
1496
(wasmtime::component::__internal::Vec<SomeRecord>,),
1497
>(&mut store, &self.record_list_reverse)?
1498
.func();
1499
let variant_list = *_instance
1500
.get_typed_func::<
1501
(&[SomeVariant],),
1502
(wasmtime::component::__internal::Vec<OtherVariant>,),
1503
>(&mut store, &self.variant_list)?
1504
.func();
1505
let load_store_everything = *_instance
1506
.get_typed_func::<
1507
(&LoadStoreAllSizes,),
1508
(LoadStoreAllSizes,),
1509
>(&mut store, &self.load_store_everything)?
1510
.func();
1511
Ok(Guest {
1512
list_u8_param,
1513
list_u16_param,
1514
list_u32_param,
1515
list_u64_param,
1516
list_s8_param,
1517
list_s16_param,
1518
list_s32_param,
1519
list_s64_param,
1520
list_f32_param,
1521
list_f64_param,
1522
list_u8_ret,
1523
list_u16_ret,
1524
list_u32_ret,
1525
list_u64_ret,
1526
list_s8_ret,
1527
list_s16_ret,
1528
list_s32_ret,
1529
list_s64_ret,
1530
list_f32_ret,
1531
list_f64_ret,
1532
tuple_list,
1533
string_list_arg,
1534
string_list_ret,
1535
tuple_string_list,
1536
string_list,
1537
record_list,
1538
record_list_reverse,
1539
variant_list,
1540
load_store_everything,
1541
})
1542
}
1543
}
1544
impl Guest {
1545
pub fn call_list_u8_param<S: wasmtime::AsContextMut>(
1546
&self,
1547
mut store: S,
1548
arg0: &[u8],
1549
) -> wasmtime::Result<()> {
1550
let callee = unsafe {
1551
wasmtime::component::TypedFunc::<
1552
(&[u8],),
1553
(),
1554
>::new_unchecked(self.list_u8_param)
1555
};
1556
let () = callee.call(store.as_context_mut(), (arg0,))?;
1557
callee.post_return(store.as_context_mut())?;
1558
Ok(())
1559
}
1560
pub fn call_list_u16_param<S: wasmtime::AsContextMut>(
1561
&self,
1562
mut store: S,
1563
arg0: &[u16],
1564
) -> wasmtime::Result<()> {
1565
let callee = unsafe {
1566
wasmtime::component::TypedFunc::<
1567
(&[u16],),
1568
(),
1569
>::new_unchecked(self.list_u16_param)
1570
};
1571
let () = callee.call(store.as_context_mut(), (arg0,))?;
1572
callee.post_return(store.as_context_mut())?;
1573
Ok(())
1574
}
1575
pub fn call_list_u32_param<S: wasmtime::AsContextMut>(
1576
&self,
1577
mut store: S,
1578
arg0: &[u32],
1579
) -> wasmtime::Result<()> {
1580
let callee = unsafe {
1581
wasmtime::component::TypedFunc::<
1582
(&[u32],),
1583
(),
1584
>::new_unchecked(self.list_u32_param)
1585
};
1586
let () = callee.call(store.as_context_mut(), (arg0,))?;
1587
callee.post_return(store.as_context_mut())?;
1588
Ok(())
1589
}
1590
pub fn call_list_u64_param<S: wasmtime::AsContextMut>(
1591
&self,
1592
mut store: S,
1593
arg0: &[u64],
1594
) -> wasmtime::Result<()> {
1595
let callee = unsafe {
1596
wasmtime::component::TypedFunc::<
1597
(&[u64],),
1598
(),
1599
>::new_unchecked(self.list_u64_param)
1600
};
1601
let () = callee.call(store.as_context_mut(), (arg0,))?;
1602
callee.post_return(store.as_context_mut())?;
1603
Ok(())
1604
}
1605
pub fn call_list_s8_param<S: wasmtime::AsContextMut>(
1606
&self,
1607
mut store: S,
1608
arg0: &[i8],
1609
) -> wasmtime::Result<()> {
1610
let callee = unsafe {
1611
wasmtime::component::TypedFunc::<
1612
(&[i8],),
1613
(),
1614
>::new_unchecked(self.list_s8_param)
1615
};
1616
let () = callee.call(store.as_context_mut(), (arg0,))?;
1617
callee.post_return(store.as_context_mut())?;
1618
Ok(())
1619
}
1620
pub fn call_list_s16_param<S: wasmtime::AsContextMut>(
1621
&self,
1622
mut store: S,
1623
arg0: &[i16],
1624
) -> wasmtime::Result<()> {
1625
let callee = unsafe {
1626
wasmtime::component::TypedFunc::<
1627
(&[i16],),
1628
(),
1629
>::new_unchecked(self.list_s16_param)
1630
};
1631
let () = callee.call(store.as_context_mut(), (arg0,))?;
1632
callee.post_return(store.as_context_mut())?;
1633
Ok(())
1634
}
1635
pub fn call_list_s32_param<S: wasmtime::AsContextMut>(
1636
&self,
1637
mut store: S,
1638
arg0: &[i32],
1639
) -> wasmtime::Result<()> {
1640
let callee = unsafe {
1641
wasmtime::component::TypedFunc::<
1642
(&[i32],),
1643
(),
1644
>::new_unchecked(self.list_s32_param)
1645
};
1646
let () = callee.call(store.as_context_mut(), (arg0,))?;
1647
callee.post_return(store.as_context_mut())?;
1648
Ok(())
1649
}
1650
pub fn call_list_s64_param<S: wasmtime::AsContextMut>(
1651
&self,
1652
mut store: S,
1653
arg0: &[i64],
1654
) -> wasmtime::Result<()> {
1655
let callee = unsafe {
1656
wasmtime::component::TypedFunc::<
1657
(&[i64],),
1658
(),
1659
>::new_unchecked(self.list_s64_param)
1660
};
1661
let () = callee.call(store.as_context_mut(), (arg0,))?;
1662
callee.post_return(store.as_context_mut())?;
1663
Ok(())
1664
}
1665
pub fn call_list_f32_param<S: wasmtime::AsContextMut>(
1666
&self,
1667
mut store: S,
1668
arg0: &[f32],
1669
) -> wasmtime::Result<()> {
1670
let callee = unsafe {
1671
wasmtime::component::TypedFunc::<
1672
(&[f32],),
1673
(),
1674
>::new_unchecked(self.list_f32_param)
1675
};
1676
let () = callee.call(store.as_context_mut(), (arg0,))?;
1677
callee.post_return(store.as_context_mut())?;
1678
Ok(())
1679
}
1680
pub fn call_list_f64_param<S: wasmtime::AsContextMut>(
1681
&self,
1682
mut store: S,
1683
arg0: &[f64],
1684
) -> wasmtime::Result<()> {
1685
let callee = unsafe {
1686
wasmtime::component::TypedFunc::<
1687
(&[f64],),
1688
(),
1689
>::new_unchecked(self.list_f64_param)
1690
};
1691
let () = callee.call(store.as_context_mut(), (arg0,))?;
1692
callee.post_return(store.as_context_mut())?;
1693
Ok(())
1694
}
1695
pub fn call_list_u8_ret<S: wasmtime::AsContextMut>(
1696
&self,
1697
mut store: S,
1698
) -> wasmtime::Result<wasmtime::component::__internal::Vec<u8>> {
1699
let callee = unsafe {
1700
wasmtime::component::TypedFunc::<
1701
(),
1702
(wasmtime::component::__internal::Vec<u8>,),
1703
>::new_unchecked(self.list_u8_ret)
1704
};
1705
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1706
callee.post_return(store.as_context_mut())?;
1707
Ok(ret0)
1708
}
1709
pub fn call_list_u16_ret<S: wasmtime::AsContextMut>(
1710
&self,
1711
mut store: S,
1712
) -> wasmtime::Result<wasmtime::component::__internal::Vec<u16>> {
1713
let callee = unsafe {
1714
wasmtime::component::TypedFunc::<
1715
(),
1716
(wasmtime::component::__internal::Vec<u16>,),
1717
>::new_unchecked(self.list_u16_ret)
1718
};
1719
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1720
callee.post_return(store.as_context_mut())?;
1721
Ok(ret0)
1722
}
1723
pub fn call_list_u32_ret<S: wasmtime::AsContextMut>(
1724
&self,
1725
mut store: S,
1726
) -> wasmtime::Result<wasmtime::component::__internal::Vec<u32>> {
1727
let callee = unsafe {
1728
wasmtime::component::TypedFunc::<
1729
(),
1730
(wasmtime::component::__internal::Vec<u32>,),
1731
>::new_unchecked(self.list_u32_ret)
1732
};
1733
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1734
callee.post_return(store.as_context_mut())?;
1735
Ok(ret0)
1736
}
1737
pub fn call_list_u64_ret<S: wasmtime::AsContextMut>(
1738
&self,
1739
mut store: S,
1740
) -> wasmtime::Result<wasmtime::component::__internal::Vec<u64>> {
1741
let callee = unsafe {
1742
wasmtime::component::TypedFunc::<
1743
(),
1744
(wasmtime::component::__internal::Vec<u64>,),
1745
>::new_unchecked(self.list_u64_ret)
1746
};
1747
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1748
callee.post_return(store.as_context_mut())?;
1749
Ok(ret0)
1750
}
1751
pub fn call_list_s8_ret<S: wasmtime::AsContextMut>(
1752
&self,
1753
mut store: S,
1754
) -> wasmtime::Result<wasmtime::component::__internal::Vec<i8>> {
1755
let callee = unsafe {
1756
wasmtime::component::TypedFunc::<
1757
(),
1758
(wasmtime::component::__internal::Vec<i8>,),
1759
>::new_unchecked(self.list_s8_ret)
1760
};
1761
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1762
callee.post_return(store.as_context_mut())?;
1763
Ok(ret0)
1764
}
1765
pub fn call_list_s16_ret<S: wasmtime::AsContextMut>(
1766
&self,
1767
mut store: S,
1768
) -> wasmtime::Result<wasmtime::component::__internal::Vec<i16>> {
1769
let callee = unsafe {
1770
wasmtime::component::TypedFunc::<
1771
(),
1772
(wasmtime::component::__internal::Vec<i16>,),
1773
>::new_unchecked(self.list_s16_ret)
1774
};
1775
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1776
callee.post_return(store.as_context_mut())?;
1777
Ok(ret0)
1778
}
1779
pub fn call_list_s32_ret<S: wasmtime::AsContextMut>(
1780
&self,
1781
mut store: S,
1782
) -> wasmtime::Result<wasmtime::component::__internal::Vec<i32>> {
1783
let callee = unsafe {
1784
wasmtime::component::TypedFunc::<
1785
(),
1786
(wasmtime::component::__internal::Vec<i32>,),
1787
>::new_unchecked(self.list_s32_ret)
1788
};
1789
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1790
callee.post_return(store.as_context_mut())?;
1791
Ok(ret0)
1792
}
1793
pub fn call_list_s64_ret<S: wasmtime::AsContextMut>(
1794
&self,
1795
mut store: S,
1796
) -> wasmtime::Result<wasmtime::component::__internal::Vec<i64>> {
1797
let callee = unsafe {
1798
wasmtime::component::TypedFunc::<
1799
(),
1800
(wasmtime::component::__internal::Vec<i64>,),
1801
>::new_unchecked(self.list_s64_ret)
1802
};
1803
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1804
callee.post_return(store.as_context_mut())?;
1805
Ok(ret0)
1806
}
1807
pub fn call_list_f32_ret<S: wasmtime::AsContextMut>(
1808
&self,
1809
mut store: S,
1810
) -> wasmtime::Result<wasmtime::component::__internal::Vec<f32>> {
1811
let callee = unsafe {
1812
wasmtime::component::TypedFunc::<
1813
(),
1814
(wasmtime::component::__internal::Vec<f32>,),
1815
>::new_unchecked(self.list_f32_ret)
1816
};
1817
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1818
callee.post_return(store.as_context_mut())?;
1819
Ok(ret0)
1820
}
1821
pub fn call_list_f64_ret<S: wasmtime::AsContextMut>(
1822
&self,
1823
mut store: S,
1824
) -> wasmtime::Result<wasmtime::component::__internal::Vec<f64>> {
1825
let callee = unsafe {
1826
wasmtime::component::TypedFunc::<
1827
(),
1828
(wasmtime::component::__internal::Vec<f64>,),
1829
>::new_unchecked(self.list_f64_ret)
1830
};
1831
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1832
callee.post_return(store.as_context_mut())?;
1833
Ok(ret0)
1834
}
1835
pub fn call_tuple_list<S: wasmtime::AsContextMut>(
1836
&self,
1837
mut store: S,
1838
arg0: &[(u8, i8)],
1839
) -> wasmtime::Result<
1840
wasmtime::component::__internal::Vec<(i64, u32)>,
1841
> {
1842
let callee = unsafe {
1843
wasmtime::component::TypedFunc::<
1844
(&[(u8, i8)],),
1845
(wasmtime::component::__internal::Vec<(i64, u32)>,),
1846
>::new_unchecked(self.tuple_list)
1847
};
1848
let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;
1849
callee.post_return(store.as_context_mut())?;
1850
Ok(ret0)
1851
}
1852
pub fn call_string_list_arg<S: wasmtime::AsContextMut>(
1853
&self,
1854
mut store: S,
1855
arg0: &[wasmtime::component::__internal::String],
1856
) -> wasmtime::Result<()> {
1857
let callee = unsafe {
1858
wasmtime::component::TypedFunc::<
1859
(&[wasmtime::component::__internal::String],),
1860
(),
1861
>::new_unchecked(self.string_list_arg)
1862
};
1863
let () = callee.call(store.as_context_mut(), (arg0,))?;
1864
callee.post_return(store.as_context_mut())?;
1865
Ok(())
1866
}
1867
pub fn call_string_list_ret<S: wasmtime::AsContextMut>(
1868
&self,
1869
mut store: S,
1870
) -> wasmtime::Result<
1871
wasmtime::component::__internal::Vec<
1872
wasmtime::component::__internal::String,
1873
>,
1874
> {
1875
let callee = unsafe {
1876
wasmtime::component::TypedFunc::<
1877
(),
1878
(
1879
wasmtime::component::__internal::Vec<
1880
wasmtime::component::__internal::String,
1881
>,
1882
),
1883
>::new_unchecked(self.string_list_ret)
1884
};
1885
let (ret0,) = callee.call(store.as_context_mut(), ())?;
1886
callee.post_return(store.as_context_mut())?;
1887
Ok(ret0)
1888
}
1889
pub fn call_tuple_string_list<S: wasmtime::AsContextMut>(
1890
&self,
1891
mut store: S,
1892
arg0: &[(u8, wasmtime::component::__internal::String)],
1893
) -> wasmtime::Result<
1894
wasmtime::component::__internal::Vec<
1895
(wasmtime::component::__internal::String, u8),
1896
>,
1897
> {
1898
let callee = unsafe {
1899
wasmtime::component::TypedFunc::<
1900
(&[(u8, wasmtime::component::__internal::String)],),
1901
(
1902
wasmtime::component::__internal::Vec<
1903
(wasmtime::component::__internal::String, u8),
1904
>,
1905
),
1906
>::new_unchecked(self.tuple_string_list)
1907
};
1908
let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;
1909
callee.post_return(store.as_context_mut())?;
1910
Ok(ret0)
1911
}
1912
pub fn call_string_list<S: wasmtime::AsContextMut>(
1913
&self,
1914
mut store: S,
1915
arg0: &[wasmtime::component::__internal::String],
1916
) -> wasmtime::Result<
1917
wasmtime::component::__internal::Vec<
1918
wasmtime::component::__internal::String,
1919
>,
1920
> {
1921
let callee = unsafe {
1922
wasmtime::component::TypedFunc::<
1923
(&[wasmtime::component::__internal::String],),
1924
(
1925
wasmtime::component::__internal::Vec<
1926
wasmtime::component::__internal::String,
1927
>,
1928
),
1929
>::new_unchecked(self.string_list)
1930
};
1931
let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;
1932
callee.post_return(store.as_context_mut())?;
1933
Ok(ret0)
1934
}
1935
pub fn call_record_list<S: wasmtime::AsContextMut>(
1936
&self,
1937
mut store: S,
1938
arg0: &[SomeRecord],
1939
) -> wasmtime::Result<
1940
wasmtime::component::__internal::Vec<OtherRecord>,
1941
> {
1942
let callee = unsafe {
1943
wasmtime::component::TypedFunc::<
1944
(&[SomeRecord],),
1945
(wasmtime::component::__internal::Vec<OtherRecord>,),
1946
>::new_unchecked(self.record_list)
1947
};
1948
let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;
1949
callee.post_return(store.as_context_mut())?;
1950
Ok(ret0)
1951
}
1952
pub fn call_record_list_reverse<S: wasmtime::AsContextMut>(
1953
&self,
1954
mut store: S,
1955
arg0: &[OtherRecord],
1956
) -> wasmtime::Result<
1957
wasmtime::component::__internal::Vec<SomeRecord>,
1958
> {
1959
let callee = unsafe {
1960
wasmtime::component::TypedFunc::<
1961
(&[OtherRecord],),
1962
(wasmtime::component::__internal::Vec<SomeRecord>,),
1963
>::new_unchecked(self.record_list_reverse)
1964
};
1965
let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;
1966
callee.post_return(store.as_context_mut())?;
1967
Ok(ret0)
1968
}
1969
pub fn call_variant_list<S: wasmtime::AsContextMut>(
1970
&self,
1971
mut store: S,
1972
arg0: &[SomeVariant],
1973
) -> wasmtime::Result<
1974
wasmtime::component::__internal::Vec<OtherVariant>,
1975
> {
1976
let callee = unsafe {
1977
wasmtime::component::TypedFunc::<
1978
(&[SomeVariant],),
1979
(wasmtime::component::__internal::Vec<OtherVariant>,),
1980
>::new_unchecked(self.variant_list)
1981
};
1982
let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;
1983
callee.post_return(store.as_context_mut())?;
1984
Ok(ret0)
1985
}
1986
pub fn call_load_store_everything<S: wasmtime::AsContextMut>(
1987
&self,
1988
mut store: S,
1989
arg0: &LoadStoreAllSizes,
1990
) -> wasmtime::Result<LoadStoreAllSizes> {
1991
let callee = unsafe {
1992
wasmtime::component::TypedFunc::<
1993
(&LoadStoreAllSizes,),
1994
(LoadStoreAllSizes,),
1995
>::new_unchecked(self.load_store_everything)
1996
};
1997
let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;
1998
callee.post_return(store.as_context_mut())?;
1999
Ok(ret0)
2000
}
2001
}
2002
}
2003
}
2004
}
2005
}
2006
2007