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> { 10 instance_pre: wasmtime::component::InstancePre<T>, 11 indices: TheListsIndices, 12 } 13 impl<T> 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> 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 async fn instantiate_async( 47 &self, 48 mut store: impl wasmtime::AsContextMut<Data = _T>, 49 ) -> wasmtime::Result<TheLists> 50 where 51 _T: Send + 'static, 52 { 53 let mut store = store.as_context_mut(); 54 let instance = self.instance_pre.instantiate_async(&mut store).await?; 55 self.indices.load(&mut store, &instance) 56 } 57 } 58 /// Auto-generated bindings for index of the exports of 59 /// `the-lists`. 60 /// 61 /// This is an implementation detail of [`TheListsPre`] and can 62 /// be constructed if needed as well. 63 /// 64 /// For more information see [`TheLists`] as well. 65 #[derive(Clone)] 66 pub struct TheListsIndices { 67 interface0: exports::foo::foo::lists::GuestIndices, 68 } 69 /// Auto-generated bindings for an instance a component which 70 /// implements the world `the-lists`. 71 /// 72 /// This structure can be created through a number of means 73 /// depending on your requirements and what you have on hand: 74 /// 75 /// * The most convenient way is to use 76 /// [`TheLists::instantiate_async`] which only needs a 77 /// [`Store`], [`Component`], and [`Linker`]. 78 /// 79 /// * Alternatively you can create a [`TheListsPre`] ahead of 80 /// time with a [`Component`] to front-load string lookups 81 /// of exports once instead of per-instantiation. This 82 /// method then uses [`TheListsPre::instantiate_async`] to 83 /// create a [`TheLists`]. 84 /// 85 /// * If you've instantiated the instance yourself already 86 /// then you can use [`TheLists::new`]. 87 /// 88 /// These methods are all equivalent to one another and move 89 /// around the tradeoff of what work is performed when. 90 /// 91 /// [`Store`]: wasmtime::Store 92 /// [`Component`]: wasmtime::component::Component 93 /// [`Linker`]: wasmtime::component::Linker 94 pub struct TheLists { 95 interface0: exports::foo::foo::lists::Guest, 96 } 97 const _: () = { 98 #[allow(unused_imports)] 99 use wasmtime::component::__internal::anyhow; 100 impl TheListsIndices { 101 /// Creates a new copy of `TheListsIndices` bindings which can then 102 /// be used to instantiate into a particular store. 103 /// 104 /// This method may fail if the component does not have the 105 /// required exports. 106 pub fn new<_T>( 107 _instance_pre: &wasmtime::component::InstancePre<_T>, 108 ) -> wasmtime::Result<Self> { 109 let _component = _instance_pre.component(); 110 let _instance_type = _instance_pre.instance_type(); 111 let interface0 = exports::foo::foo::lists::GuestIndices::new(_instance_pre)?; 112 Ok(TheListsIndices { interface0 }) 113 } 114 /// Uses the indices stored in `self` to load an instance 115 /// of [`TheLists`] from the instance provided. 116 /// 117 /// Note that at this time this method will additionally 118 /// perform type-checks of all exports. 119 pub fn load( 120 &self, 121 mut store: impl wasmtime::AsContextMut, 122 instance: &wasmtime::component::Instance, 123 ) -> wasmtime::Result<TheLists> { 124 let _ = &mut store; 125 let _instance = instance; 126 let interface0 = self.interface0.load(&mut store, &_instance)?; 127 Ok(TheLists { interface0 }) 128 } 129 } 130 impl TheLists { 131 /// Convenience wrapper around [`TheListsPre::new`] and 132 /// [`TheListsPre::instantiate_async`]. 133 pub async fn instantiate_async<_T>( 134 store: impl wasmtime::AsContextMut<Data = _T>, 135 component: &wasmtime::component::Component, 136 linker: &wasmtime::component::Linker<_T>, 137 ) -> wasmtime::Result<TheLists> 138 where 139 _T: Send + 'static, 140 { 141 let pre = linker.instantiate_pre(component)?; 142 TheListsPre::new(pre)?.instantiate_async(store).await 143 } 144 /// Convenience wrapper around [`TheListsIndices::new`] and 145 /// [`TheListsIndices::load`]. 146 pub fn new( 147 mut store: impl wasmtime::AsContextMut, 148 instance: &wasmtime::component::Instance, 149 ) -> wasmtime::Result<TheLists> { 150 let indices = TheListsIndices::new(&instance.instance_pre(&store))?; 151 indices.load(&mut store, instance) 152 } 153 pub fn add_to_linker<T, U>( 154 linker: &mut wasmtime::component::Linker<T>, 155 get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static, 156 ) -> wasmtime::Result<()> 157 where 158 T: Send + foo::foo::lists::Host<Data = T> + 'static, 159 U: Send + foo::foo::lists::Host<Data = T>, 160 { 161 foo::foo::lists::add_to_linker(linker, get)?; 162 Ok(()) 163 } 164 pub fn foo_foo_lists(&self) -> &exports::foo::foo::lists::Guest { 165 &self.interface0 166 } 167 } 168 }; 169 pub mod foo { 170 pub mod foo { 171 #[allow(clippy::all)] 172 pub mod lists { 173 #[allow(unused_imports)] 174 use wasmtime::component::__internal::{anyhow, Box}; 175 #[derive(wasmtime::component::ComponentType)] 176 #[derive(wasmtime::component::Lift)] 177 #[derive(wasmtime::component::Lower)] 178 #[component(record)] 179 #[derive(Clone)] 180 pub struct OtherRecord { 181 #[component(name = "a1")] 182 pub a1: u32, 183 #[component(name = "a2")] 184 pub a2: u64, 185 #[component(name = "a3")] 186 pub a3: i32, 187 #[component(name = "a4")] 188 pub a4: i64, 189 #[component(name = "b")] 190 pub b: wasmtime::component::__internal::String, 191 #[component(name = "c")] 192 pub c: wasmtime::component::__internal::Vec<u8>, 193 } 194 impl core::fmt::Debug for OtherRecord { 195 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 196 f.debug_struct("OtherRecord") 197 .field("a1", &self.a1) 198 .field("a2", &self.a2) 199 .field("a3", &self.a3) 200 .field("a4", &self.a4) 201 .field("b", &self.b) 202 .field("c", &self.c) 203 .finish() 204 } 205 } 206 const _: () = { 207 assert!( 208 48 == < OtherRecord as wasmtime::component::ComponentType >::SIZE32 209 ); 210 assert!( 211 8 == < OtherRecord as wasmtime::component::ComponentType >::ALIGN32 212 ); 213 }; 214 #[derive(wasmtime::component::ComponentType)] 215 #[derive(wasmtime::component::Lift)] 216 #[derive(wasmtime::component::Lower)] 217 #[component(record)] 218 #[derive(Clone)] 219 pub struct SomeRecord { 220 #[component(name = "x")] 221 pub x: wasmtime::component::__internal::String, 222 #[component(name = "y")] 223 pub y: OtherRecord, 224 #[component(name = "z")] 225 pub z: wasmtime::component::__internal::Vec<OtherRecord>, 226 #[component(name = "c1")] 227 pub c1: u32, 228 #[component(name = "c2")] 229 pub c2: u64, 230 #[component(name = "c3")] 231 pub c3: i32, 232 #[component(name = "c4")] 233 pub c4: i64, 234 } 235 impl core::fmt::Debug for SomeRecord { 236 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 237 f.debug_struct("SomeRecord") 238 .field("x", &self.x) 239 .field("y", &self.y) 240 .field("z", &self.z) 241 .field("c1", &self.c1) 242 .field("c2", &self.c2) 243 .field("c3", &self.c3) 244 .field("c4", &self.c4) 245 .finish() 246 } 247 } 248 const _: () = { 249 assert!( 250 96 == < SomeRecord as wasmtime::component::ComponentType >::SIZE32 251 ); 252 assert!( 253 8 == < SomeRecord as wasmtime::component::ComponentType >::ALIGN32 254 ); 255 }; 256 #[derive(wasmtime::component::ComponentType)] 257 #[derive(wasmtime::component::Lift)] 258 #[derive(wasmtime::component::Lower)] 259 #[component(variant)] 260 #[derive(Clone)] 261 pub enum OtherVariant { 262 #[component(name = "a")] 263 A, 264 #[component(name = "b")] 265 B(u32), 266 #[component(name = "c")] 267 C(wasmtime::component::__internal::String), 268 } 269 impl core::fmt::Debug for OtherVariant { 270 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 271 match self { 272 OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(), 273 OtherVariant::B(e) => { 274 f.debug_tuple("OtherVariant::B").field(e).finish() 275 } 276 OtherVariant::C(e) => { 277 f.debug_tuple("OtherVariant::C").field(e).finish() 278 } 279 } 280 } 281 } 282 const _: () = { 283 assert!( 284 12 == < OtherVariant as wasmtime::component::ComponentType >::SIZE32 285 ); 286 assert!( 287 4 == < OtherVariant as wasmtime::component::ComponentType >::ALIGN32 288 ); 289 }; 290 #[derive(wasmtime::component::ComponentType)] 291 #[derive(wasmtime::component::Lift)] 292 #[derive(wasmtime::component::Lower)] 293 #[component(variant)] 294 #[derive(Clone)] 295 pub enum SomeVariant { 296 #[component(name = "a")] 297 A(wasmtime::component::__internal::String), 298 #[component(name = "b")] 299 B, 300 #[component(name = "c")] 301 C(u32), 302 #[component(name = "d")] 303 D(wasmtime::component::__internal::Vec<OtherVariant>), 304 } 305 impl core::fmt::Debug for SomeVariant { 306 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 307 match self { 308 SomeVariant::A(e) => { 309 f.debug_tuple("SomeVariant::A").field(e).finish() 310 } 311 SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(), 312 SomeVariant::C(e) => { 313 f.debug_tuple("SomeVariant::C").field(e).finish() 314 } 315 SomeVariant::D(e) => { 316 f.debug_tuple("SomeVariant::D").field(e).finish() 317 } 318 } 319 } 320 } 321 const _: () = { 322 assert!( 323 12 == < SomeVariant as wasmtime::component::ComponentType >::SIZE32 324 ); 325 assert!( 326 4 == < SomeVariant as wasmtime::component::ComponentType >::ALIGN32 327 ); 328 }; 329 pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec< 330 ( 331 wasmtime::component::__internal::String, 332 u8, 333 i8, 334 u16, 335 i16, 336 u32, 337 i32, 338 u64, 339 i64, 340 f32, 341 f64, 342 char, 343 ), 344 >; 345 const _: () = { 346 assert!( 347 8 == < LoadStoreAllSizes as wasmtime::component::ComponentType 348 >::SIZE32 349 ); 350 assert!( 351 4 == < LoadStoreAllSizes as wasmtime::component::ComponentType 352 >::ALIGN32 353 ); 354 }; 355 pub trait Host { 356 type Data; 357 fn list_u8_param( 358 store: wasmtime::StoreContextMut<'_, Self::Data>, 359 x: wasmtime::component::__internal::Vec<u8>, 360 ) -> impl ::core::future::Future< 361 Output = impl FnOnce( 362 wasmtime::StoreContextMut<'_, Self::Data>, 363 ) -> () + Send + Sync + 'static, 364 > + Send + Sync + 'static 365 where 366 Self: Sized; 367 fn list_u16_param( 368 store: wasmtime::StoreContextMut<'_, Self::Data>, 369 x: wasmtime::component::__internal::Vec<u16>, 370 ) -> impl ::core::future::Future< 371 Output = impl FnOnce( 372 wasmtime::StoreContextMut<'_, Self::Data>, 373 ) -> () + Send + Sync + 'static, 374 > + Send + Sync + 'static 375 where 376 Self: Sized; 377 fn list_u32_param( 378 store: wasmtime::StoreContextMut<'_, Self::Data>, 379 x: wasmtime::component::__internal::Vec<u32>, 380 ) -> impl ::core::future::Future< 381 Output = impl FnOnce( 382 wasmtime::StoreContextMut<'_, Self::Data>, 383 ) -> () + Send + Sync + 'static, 384 > + Send + Sync + 'static 385 where 386 Self: Sized; 387 fn list_u64_param( 388 store: wasmtime::StoreContextMut<'_, Self::Data>, 389 x: wasmtime::component::__internal::Vec<u64>, 390 ) -> impl ::core::future::Future< 391 Output = impl FnOnce( 392 wasmtime::StoreContextMut<'_, Self::Data>, 393 ) -> () + Send + Sync + 'static, 394 > + Send + Sync + 'static 395 where 396 Self: Sized; 397 fn list_s8_param( 398 store: wasmtime::StoreContextMut<'_, Self::Data>, 399 x: wasmtime::component::__internal::Vec<i8>, 400 ) -> impl ::core::future::Future< 401 Output = impl FnOnce( 402 wasmtime::StoreContextMut<'_, Self::Data>, 403 ) -> () + Send + Sync + 'static, 404 > + Send + Sync + 'static 405 where 406 Self: Sized; 407 fn list_s16_param( 408 store: wasmtime::StoreContextMut<'_, Self::Data>, 409 x: wasmtime::component::__internal::Vec<i16>, 410 ) -> impl ::core::future::Future< 411 Output = impl FnOnce( 412 wasmtime::StoreContextMut<'_, Self::Data>, 413 ) -> () + Send + Sync + 'static, 414 > + Send + Sync + 'static 415 where 416 Self: Sized; 417 fn list_s32_param( 418 store: wasmtime::StoreContextMut<'_, Self::Data>, 419 x: wasmtime::component::__internal::Vec<i32>, 420 ) -> impl ::core::future::Future< 421 Output = impl FnOnce( 422 wasmtime::StoreContextMut<'_, Self::Data>, 423 ) -> () + Send + Sync + 'static, 424 > + Send + Sync + 'static 425 where 426 Self: Sized; 427 fn list_s64_param( 428 store: wasmtime::StoreContextMut<'_, Self::Data>, 429 x: wasmtime::component::__internal::Vec<i64>, 430 ) -> impl ::core::future::Future< 431 Output = impl FnOnce( 432 wasmtime::StoreContextMut<'_, Self::Data>, 433 ) -> () + Send + Sync + 'static, 434 > + Send + Sync + 'static 435 where 436 Self: Sized; 437 fn list_f32_param( 438 store: wasmtime::StoreContextMut<'_, Self::Data>, 439 x: wasmtime::component::__internal::Vec<f32>, 440 ) -> impl ::core::future::Future< 441 Output = impl FnOnce( 442 wasmtime::StoreContextMut<'_, Self::Data>, 443 ) -> () + Send + Sync + 'static, 444 > + Send + Sync + 'static 445 where 446 Self: Sized; 447 fn list_f64_param( 448 store: wasmtime::StoreContextMut<'_, Self::Data>, 449 x: wasmtime::component::__internal::Vec<f64>, 450 ) -> impl ::core::future::Future< 451 Output = impl FnOnce( 452 wasmtime::StoreContextMut<'_, Self::Data>, 453 ) -> () + Send + Sync + 'static, 454 > + Send + Sync + 'static 455 where 456 Self: Sized; 457 fn list_u8_ret( 458 store: wasmtime::StoreContextMut<'_, Self::Data>, 459 ) -> impl ::core::future::Future< 460 Output = impl FnOnce( 461 wasmtime::StoreContextMut<'_, Self::Data>, 462 ) -> wasmtime::component::__internal::Vec<u8> + Send + Sync + 'static, 463 > + Send + Sync + 'static 464 where 465 Self: Sized; 466 fn list_u16_ret( 467 store: wasmtime::StoreContextMut<'_, Self::Data>, 468 ) -> impl ::core::future::Future< 469 Output = impl FnOnce( 470 wasmtime::StoreContextMut<'_, Self::Data>, 471 ) -> wasmtime::component::__internal::Vec< 472 u16, 473 > + Send + Sync + 'static, 474 > + Send + Sync + 'static 475 where 476 Self: Sized; 477 fn list_u32_ret( 478 store: wasmtime::StoreContextMut<'_, Self::Data>, 479 ) -> impl ::core::future::Future< 480 Output = impl FnOnce( 481 wasmtime::StoreContextMut<'_, Self::Data>, 482 ) -> wasmtime::component::__internal::Vec< 483 u32, 484 > + Send + Sync + 'static, 485 > + Send + Sync + 'static 486 where 487 Self: Sized; 488 fn list_u64_ret( 489 store: wasmtime::StoreContextMut<'_, Self::Data>, 490 ) -> impl ::core::future::Future< 491 Output = impl FnOnce( 492 wasmtime::StoreContextMut<'_, Self::Data>, 493 ) -> wasmtime::component::__internal::Vec< 494 u64, 495 > + Send + Sync + 'static, 496 > + Send + Sync + 'static 497 where 498 Self: Sized; 499 fn list_s8_ret( 500 store: wasmtime::StoreContextMut<'_, Self::Data>, 501 ) -> impl ::core::future::Future< 502 Output = impl FnOnce( 503 wasmtime::StoreContextMut<'_, Self::Data>, 504 ) -> wasmtime::component::__internal::Vec<i8> + Send + Sync + 'static, 505 > + Send + Sync + 'static 506 where 507 Self: Sized; 508 fn list_s16_ret( 509 store: wasmtime::StoreContextMut<'_, Self::Data>, 510 ) -> impl ::core::future::Future< 511 Output = impl FnOnce( 512 wasmtime::StoreContextMut<'_, Self::Data>, 513 ) -> wasmtime::component::__internal::Vec< 514 i16, 515 > + Send + Sync + 'static, 516 > + Send + Sync + 'static 517 where 518 Self: Sized; 519 fn list_s32_ret( 520 store: wasmtime::StoreContextMut<'_, Self::Data>, 521 ) -> impl ::core::future::Future< 522 Output = impl FnOnce( 523 wasmtime::StoreContextMut<'_, Self::Data>, 524 ) -> wasmtime::component::__internal::Vec< 525 i32, 526 > + Send + Sync + 'static, 527 > + Send + Sync + 'static 528 where 529 Self: Sized; 530 fn list_s64_ret( 531 store: wasmtime::StoreContextMut<'_, Self::Data>, 532 ) -> impl ::core::future::Future< 533 Output = impl FnOnce( 534 wasmtime::StoreContextMut<'_, Self::Data>, 535 ) -> wasmtime::component::__internal::Vec< 536 i64, 537 > + Send + Sync + 'static, 538 > + Send + Sync + 'static 539 where 540 Self: Sized; 541 fn list_f32_ret( 542 store: wasmtime::StoreContextMut<'_, Self::Data>, 543 ) -> impl ::core::future::Future< 544 Output = impl FnOnce( 545 wasmtime::StoreContextMut<'_, Self::Data>, 546 ) -> wasmtime::component::__internal::Vec< 547 f32, 548 > + Send + Sync + 'static, 549 > + Send + Sync + 'static 550 where 551 Self: Sized; 552 fn list_f64_ret( 553 store: wasmtime::StoreContextMut<'_, Self::Data>, 554 ) -> impl ::core::future::Future< 555 Output = impl FnOnce( 556 wasmtime::StoreContextMut<'_, Self::Data>, 557 ) -> wasmtime::component::__internal::Vec< 558 f64, 559 > + Send + Sync + 'static, 560 > + Send + Sync + 'static 561 where 562 Self: Sized; 563 fn tuple_list( 564 store: wasmtime::StoreContextMut<'_, Self::Data>, 565 x: wasmtime::component::__internal::Vec<(u8, i8)>, 566 ) -> impl ::core::future::Future< 567 Output = impl FnOnce( 568 wasmtime::StoreContextMut<'_, Self::Data>, 569 ) -> wasmtime::component::__internal::Vec< 570 (i64, u32), 571 > + Send + Sync + 'static, 572 > + Send + Sync + 'static 573 where 574 Self: Sized; 575 fn string_list_arg( 576 store: wasmtime::StoreContextMut<'_, Self::Data>, 577 a: wasmtime::component::__internal::Vec< 578 wasmtime::component::__internal::String, 579 >, 580 ) -> impl ::core::future::Future< 581 Output = impl FnOnce( 582 wasmtime::StoreContextMut<'_, Self::Data>, 583 ) -> () + Send + Sync + 'static, 584 > + Send + Sync + 'static 585 where 586 Self: Sized; 587 fn string_list_ret( 588 store: wasmtime::StoreContextMut<'_, Self::Data>, 589 ) -> impl ::core::future::Future< 590 Output = impl FnOnce( 591 wasmtime::StoreContextMut<'_, Self::Data>, 592 ) -> wasmtime::component::__internal::Vec< 593 wasmtime::component::__internal::String, 594 > + Send + Sync + 'static, 595 > + Send + Sync + 'static 596 where 597 Self: Sized; 598 fn tuple_string_list( 599 store: wasmtime::StoreContextMut<'_, Self::Data>, 600 x: wasmtime::component::__internal::Vec< 601 (u8, wasmtime::component::__internal::String), 602 >, 603 ) -> impl ::core::future::Future< 604 Output = impl FnOnce( 605 wasmtime::StoreContextMut<'_, Self::Data>, 606 ) -> wasmtime::component::__internal::Vec< 607 (wasmtime::component::__internal::String, u8), 608 > + Send + Sync + 'static, 609 > + Send + Sync + 'static 610 where 611 Self: Sized; 612 fn string_list( 613 store: wasmtime::StoreContextMut<'_, Self::Data>, 614 x: wasmtime::component::__internal::Vec< 615 wasmtime::component::__internal::String, 616 >, 617 ) -> impl ::core::future::Future< 618 Output = impl FnOnce( 619 wasmtime::StoreContextMut<'_, Self::Data>, 620 ) -> wasmtime::component::__internal::Vec< 621 wasmtime::component::__internal::String, 622 > + Send + Sync + 'static, 623 > + Send + Sync + 'static 624 where 625 Self: Sized; 626 fn record_list( 627 store: wasmtime::StoreContextMut<'_, Self::Data>, 628 x: wasmtime::component::__internal::Vec<SomeRecord>, 629 ) -> impl ::core::future::Future< 630 Output = impl FnOnce( 631 wasmtime::StoreContextMut<'_, Self::Data>, 632 ) -> wasmtime::component::__internal::Vec< 633 OtherRecord, 634 > + Send + Sync + 'static, 635 > + Send + Sync + 'static 636 where 637 Self: Sized; 638 fn record_list_reverse( 639 store: wasmtime::StoreContextMut<'_, Self::Data>, 640 x: wasmtime::component::__internal::Vec<OtherRecord>, 641 ) -> impl ::core::future::Future< 642 Output = impl FnOnce( 643 wasmtime::StoreContextMut<'_, Self::Data>, 644 ) -> wasmtime::component::__internal::Vec< 645 SomeRecord, 646 > + Send + Sync + 'static, 647 > + Send + Sync + 'static 648 where 649 Self: Sized; 650 fn variant_list( 651 store: wasmtime::StoreContextMut<'_, Self::Data>, 652 x: wasmtime::component::__internal::Vec<SomeVariant>, 653 ) -> impl ::core::future::Future< 654 Output = impl FnOnce( 655 wasmtime::StoreContextMut<'_, Self::Data>, 656 ) -> wasmtime::component::__internal::Vec< 657 OtherVariant, 658 > + Send + Sync + 'static, 659 > + Send + Sync + 'static 660 where 661 Self: Sized; 662 fn load_store_everything( 663 store: wasmtime::StoreContextMut<'_, Self::Data>, 664 a: LoadStoreAllSizes, 665 ) -> impl ::core::future::Future< 666 Output = impl FnOnce( 667 wasmtime::StoreContextMut<'_, Self::Data>, 668 ) -> LoadStoreAllSizes + Send + Sync + 'static, 669 > + Send + Sync + 'static 670 where 671 Self: Sized; 672 } 673 pub trait GetHost< 674 T, 675 D, 676 >: Fn(T) -> <Self as GetHost<T, D>>::Host + Send + Sync + Copy + 'static { 677 type Host: Host<Data = D> + Send; 678 } 679 impl<F, T, D, O> GetHost<T, D> for F 680 where 681 F: Fn(T) -> O + Send + Sync + Copy + 'static, 682 O: Host<Data = D> + Send, 683 { 684 type Host = O; 685 } 686 pub fn add_to_linker_get_host< 687 T, 688 G: for<'a> GetHost<&'a mut T, T, Host: Host<Data = T> + Send>, 689 >( 690 linker: &mut wasmtime::component::Linker<T>, 691 host_getter: G, 692 ) -> wasmtime::Result<()> 693 where 694 T: Send + 'static, 695 { 696 let mut inst = linker.instance("foo:foo/lists")?; 697 inst.func_wrap_concurrent( 698 "list-u8-param", 699 move | 700 mut caller: wasmtime::StoreContextMut<'_, T>, 701 (arg0,): (wasmtime::component::__internal::Vec<u8>,)| 702 { 703 let host = caller; 704 let r = <G::Host as Host>::list_u8_param(host, arg0); 705 Box::pin(async move { 706 let fun = r.await; 707 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 708 let r = fun(caller); 709 Ok(r) 710 }) 711 as Box< 712 dyn FnOnce( 713 wasmtime::StoreContextMut<'_, T>, 714 ) -> wasmtime::Result<()> + Send + Sync, 715 > 716 }) 717 as ::core::pin::Pin< 718 Box< 719 dyn ::core::future::Future< 720 Output = Box< 721 dyn FnOnce( 722 wasmtime::StoreContextMut<'_, T>, 723 ) -> wasmtime::Result<()> + Send + Sync, 724 >, 725 > + Send + Sync + 'static, 726 >, 727 > 728 }, 729 )?; 730 inst.func_wrap_concurrent( 731 "list-u16-param", 732 move | 733 mut caller: wasmtime::StoreContextMut<'_, T>, 734 (arg0,): (wasmtime::component::__internal::Vec<u16>,)| 735 { 736 let host = caller; 737 let r = <G::Host as Host>::list_u16_param(host, arg0); 738 Box::pin(async move { 739 let fun = r.await; 740 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 741 let r = fun(caller); 742 Ok(r) 743 }) 744 as Box< 745 dyn FnOnce( 746 wasmtime::StoreContextMut<'_, T>, 747 ) -> wasmtime::Result<()> + Send + Sync, 748 > 749 }) 750 as ::core::pin::Pin< 751 Box< 752 dyn ::core::future::Future< 753 Output = Box< 754 dyn FnOnce( 755 wasmtime::StoreContextMut<'_, T>, 756 ) -> wasmtime::Result<()> + Send + Sync, 757 >, 758 > + Send + Sync + 'static, 759 >, 760 > 761 }, 762 )?; 763 inst.func_wrap_concurrent( 764 "list-u32-param", 765 move | 766 mut caller: wasmtime::StoreContextMut<'_, T>, 767 (arg0,): (wasmtime::component::__internal::Vec<u32>,)| 768 { 769 let host = caller; 770 let r = <G::Host as Host>::list_u32_param(host, arg0); 771 Box::pin(async move { 772 let fun = r.await; 773 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 774 let r = fun(caller); 775 Ok(r) 776 }) 777 as Box< 778 dyn FnOnce( 779 wasmtime::StoreContextMut<'_, T>, 780 ) -> wasmtime::Result<()> + Send + Sync, 781 > 782 }) 783 as ::core::pin::Pin< 784 Box< 785 dyn ::core::future::Future< 786 Output = Box< 787 dyn FnOnce( 788 wasmtime::StoreContextMut<'_, T>, 789 ) -> wasmtime::Result<()> + Send + Sync, 790 >, 791 > + Send + Sync + 'static, 792 >, 793 > 794 }, 795 )?; 796 inst.func_wrap_concurrent( 797 "list-u64-param", 798 move | 799 mut caller: wasmtime::StoreContextMut<'_, T>, 800 (arg0,): (wasmtime::component::__internal::Vec<u64>,)| 801 { 802 let host = caller; 803 let r = <G::Host as Host>::list_u64_param(host, arg0); 804 Box::pin(async move { 805 let fun = r.await; 806 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 807 let r = fun(caller); 808 Ok(r) 809 }) 810 as Box< 811 dyn FnOnce( 812 wasmtime::StoreContextMut<'_, T>, 813 ) -> wasmtime::Result<()> + Send + Sync, 814 > 815 }) 816 as ::core::pin::Pin< 817 Box< 818 dyn ::core::future::Future< 819 Output = Box< 820 dyn FnOnce( 821 wasmtime::StoreContextMut<'_, T>, 822 ) -> wasmtime::Result<()> + Send + Sync, 823 >, 824 > + Send + Sync + 'static, 825 >, 826 > 827 }, 828 )?; 829 inst.func_wrap_concurrent( 830 "list-s8-param", 831 move | 832 mut caller: wasmtime::StoreContextMut<'_, T>, 833 (arg0,): (wasmtime::component::__internal::Vec<i8>,)| 834 { 835 let host = caller; 836 let r = <G::Host as Host>::list_s8_param(host, arg0); 837 Box::pin(async move { 838 let fun = r.await; 839 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 840 let r = fun(caller); 841 Ok(r) 842 }) 843 as Box< 844 dyn FnOnce( 845 wasmtime::StoreContextMut<'_, T>, 846 ) -> wasmtime::Result<()> + Send + Sync, 847 > 848 }) 849 as ::core::pin::Pin< 850 Box< 851 dyn ::core::future::Future< 852 Output = Box< 853 dyn FnOnce( 854 wasmtime::StoreContextMut<'_, T>, 855 ) -> wasmtime::Result<()> + Send + Sync, 856 >, 857 > + Send + Sync + 'static, 858 >, 859 > 860 }, 861 )?; 862 inst.func_wrap_concurrent( 863 "list-s16-param", 864 move | 865 mut caller: wasmtime::StoreContextMut<'_, T>, 866 (arg0,): (wasmtime::component::__internal::Vec<i16>,)| 867 { 868 let host = caller; 869 let r = <G::Host as Host>::list_s16_param(host, arg0); 870 Box::pin(async move { 871 let fun = r.await; 872 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 873 let r = fun(caller); 874 Ok(r) 875 }) 876 as Box< 877 dyn FnOnce( 878 wasmtime::StoreContextMut<'_, T>, 879 ) -> wasmtime::Result<()> + Send + Sync, 880 > 881 }) 882 as ::core::pin::Pin< 883 Box< 884 dyn ::core::future::Future< 885 Output = Box< 886 dyn FnOnce( 887 wasmtime::StoreContextMut<'_, T>, 888 ) -> wasmtime::Result<()> + Send + Sync, 889 >, 890 > + Send + Sync + 'static, 891 >, 892 > 893 }, 894 )?; 895 inst.func_wrap_concurrent( 896 "list-s32-param", 897 move | 898 mut caller: wasmtime::StoreContextMut<'_, T>, 899 (arg0,): (wasmtime::component::__internal::Vec<i32>,)| 900 { 901 let host = caller; 902 let r = <G::Host as Host>::list_s32_param(host, arg0); 903 Box::pin(async move { 904 let fun = r.await; 905 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 906 let r = fun(caller); 907 Ok(r) 908 }) 909 as Box< 910 dyn FnOnce( 911 wasmtime::StoreContextMut<'_, T>, 912 ) -> wasmtime::Result<()> + Send + Sync, 913 > 914 }) 915 as ::core::pin::Pin< 916 Box< 917 dyn ::core::future::Future< 918 Output = Box< 919 dyn FnOnce( 920 wasmtime::StoreContextMut<'_, T>, 921 ) -> wasmtime::Result<()> + Send + Sync, 922 >, 923 > + Send + Sync + 'static, 924 >, 925 > 926 }, 927 )?; 928 inst.func_wrap_concurrent( 929 "list-s64-param", 930 move | 931 mut caller: wasmtime::StoreContextMut<'_, T>, 932 (arg0,): (wasmtime::component::__internal::Vec<i64>,)| 933 { 934 let host = caller; 935 let r = <G::Host as Host>::list_s64_param(host, arg0); 936 Box::pin(async move { 937 let fun = r.await; 938 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 939 let r = fun(caller); 940 Ok(r) 941 }) 942 as Box< 943 dyn FnOnce( 944 wasmtime::StoreContextMut<'_, T>, 945 ) -> wasmtime::Result<()> + Send + Sync, 946 > 947 }) 948 as ::core::pin::Pin< 949 Box< 950 dyn ::core::future::Future< 951 Output = Box< 952 dyn FnOnce( 953 wasmtime::StoreContextMut<'_, T>, 954 ) -> wasmtime::Result<()> + Send + Sync, 955 >, 956 > + Send + Sync + 'static, 957 >, 958 > 959 }, 960 )?; 961 inst.func_wrap_concurrent( 962 "list-f32-param", 963 move | 964 mut caller: wasmtime::StoreContextMut<'_, T>, 965 (arg0,): (wasmtime::component::__internal::Vec<f32>,)| 966 { 967 let host = caller; 968 let r = <G::Host as Host>::list_f32_param(host, arg0); 969 Box::pin(async move { 970 let fun = r.await; 971 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 972 let r = fun(caller); 973 Ok(r) 974 }) 975 as Box< 976 dyn FnOnce( 977 wasmtime::StoreContextMut<'_, T>, 978 ) -> wasmtime::Result<()> + Send + Sync, 979 > 980 }) 981 as ::core::pin::Pin< 982 Box< 983 dyn ::core::future::Future< 984 Output = Box< 985 dyn FnOnce( 986 wasmtime::StoreContextMut<'_, T>, 987 ) -> wasmtime::Result<()> + Send + Sync, 988 >, 989 > + Send + Sync + 'static, 990 >, 991 > 992 }, 993 )?; 994 inst.func_wrap_concurrent( 995 "list-f64-param", 996 move | 997 mut caller: wasmtime::StoreContextMut<'_, T>, 998 (arg0,): (wasmtime::component::__internal::Vec<f64>,)| 999 { 1000 let host = caller; 1001 let r = <G::Host as Host>::list_f64_param(host, arg0); 1002 Box::pin(async move { 1003 let fun = r.await; 1004 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1005 let r = fun(caller); 1006 Ok(r) 1007 }) 1008 as Box< 1009 dyn FnOnce( 1010 wasmtime::StoreContextMut<'_, T>, 1011 ) -> wasmtime::Result<()> + Send + Sync, 1012 > 1013 }) 1014 as ::core::pin::Pin< 1015 Box< 1016 dyn ::core::future::Future< 1017 Output = Box< 1018 dyn FnOnce( 1019 wasmtime::StoreContextMut<'_, T>, 1020 ) -> wasmtime::Result<()> + Send + Sync, 1021 >, 1022 > + Send + Sync + 'static, 1023 >, 1024 > 1025 }, 1026 )?; 1027 inst.func_wrap_concurrent( 1028 "list-u8-ret", 1029 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1030 let host = caller; 1031 let r = <G::Host as Host>::list_u8_ret(host); 1032 Box::pin(async move { 1033 let fun = r.await; 1034 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1035 let r = fun(caller); 1036 Ok((r,)) 1037 }) 1038 as Box< 1039 dyn FnOnce( 1040 wasmtime::StoreContextMut<'_, T>, 1041 ) -> wasmtime::Result< 1042 (wasmtime::component::__internal::Vec<u8>,), 1043 > + Send + Sync, 1044 > 1045 }) 1046 as ::core::pin::Pin< 1047 Box< 1048 dyn ::core::future::Future< 1049 Output = Box< 1050 dyn FnOnce( 1051 wasmtime::StoreContextMut<'_, T>, 1052 ) -> wasmtime::Result< 1053 (wasmtime::component::__internal::Vec<u8>,), 1054 > + Send + Sync, 1055 >, 1056 > + Send + Sync + 'static, 1057 >, 1058 > 1059 }, 1060 )?; 1061 inst.func_wrap_concurrent( 1062 "list-u16-ret", 1063 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1064 let host = caller; 1065 let r = <G::Host as Host>::list_u16_ret(host); 1066 Box::pin(async move { 1067 let fun = r.await; 1068 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1069 let r = fun(caller); 1070 Ok((r,)) 1071 }) 1072 as Box< 1073 dyn FnOnce( 1074 wasmtime::StoreContextMut<'_, T>, 1075 ) -> wasmtime::Result< 1076 (wasmtime::component::__internal::Vec<u16>,), 1077 > + Send + Sync, 1078 > 1079 }) 1080 as ::core::pin::Pin< 1081 Box< 1082 dyn ::core::future::Future< 1083 Output = Box< 1084 dyn FnOnce( 1085 wasmtime::StoreContextMut<'_, T>, 1086 ) -> wasmtime::Result< 1087 (wasmtime::component::__internal::Vec<u16>,), 1088 > + Send + Sync, 1089 >, 1090 > + Send + Sync + 'static, 1091 >, 1092 > 1093 }, 1094 )?; 1095 inst.func_wrap_concurrent( 1096 "list-u32-ret", 1097 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1098 let host = caller; 1099 let r = <G::Host as Host>::list_u32_ret(host); 1100 Box::pin(async move { 1101 let fun = r.await; 1102 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1103 let r = fun(caller); 1104 Ok((r,)) 1105 }) 1106 as Box< 1107 dyn FnOnce( 1108 wasmtime::StoreContextMut<'_, T>, 1109 ) -> wasmtime::Result< 1110 (wasmtime::component::__internal::Vec<u32>,), 1111 > + Send + Sync, 1112 > 1113 }) 1114 as ::core::pin::Pin< 1115 Box< 1116 dyn ::core::future::Future< 1117 Output = Box< 1118 dyn FnOnce( 1119 wasmtime::StoreContextMut<'_, T>, 1120 ) -> wasmtime::Result< 1121 (wasmtime::component::__internal::Vec<u32>,), 1122 > + Send + Sync, 1123 >, 1124 > + Send + Sync + 'static, 1125 >, 1126 > 1127 }, 1128 )?; 1129 inst.func_wrap_concurrent( 1130 "list-u64-ret", 1131 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1132 let host = caller; 1133 let r = <G::Host as Host>::list_u64_ret(host); 1134 Box::pin(async move { 1135 let fun = r.await; 1136 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1137 let r = fun(caller); 1138 Ok((r,)) 1139 }) 1140 as Box< 1141 dyn FnOnce( 1142 wasmtime::StoreContextMut<'_, T>, 1143 ) -> wasmtime::Result< 1144 (wasmtime::component::__internal::Vec<u64>,), 1145 > + Send + Sync, 1146 > 1147 }) 1148 as ::core::pin::Pin< 1149 Box< 1150 dyn ::core::future::Future< 1151 Output = Box< 1152 dyn FnOnce( 1153 wasmtime::StoreContextMut<'_, T>, 1154 ) -> wasmtime::Result< 1155 (wasmtime::component::__internal::Vec<u64>,), 1156 > + Send + Sync, 1157 >, 1158 > + Send + Sync + 'static, 1159 >, 1160 > 1161 }, 1162 )?; 1163 inst.func_wrap_concurrent( 1164 "list-s8-ret", 1165 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1166 let host = caller; 1167 let r = <G::Host as Host>::list_s8_ret(host); 1168 Box::pin(async move { 1169 let fun = r.await; 1170 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1171 let r = fun(caller); 1172 Ok((r,)) 1173 }) 1174 as Box< 1175 dyn FnOnce( 1176 wasmtime::StoreContextMut<'_, T>, 1177 ) -> wasmtime::Result< 1178 (wasmtime::component::__internal::Vec<i8>,), 1179 > + Send + Sync, 1180 > 1181 }) 1182 as ::core::pin::Pin< 1183 Box< 1184 dyn ::core::future::Future< 1185 Output = Box< 1186 dyn FnOnce( 1187 wasmtime::StoreContextMut<'_, T>, 1188 ) -> wasmtime::Result< 1189 (wasmtime::component::__internal::Vec<i8>,), 1190 > + Send + Sync, 1191 >, 1192 > + Send + Sync + 'static, 1193 >, 1194 > 1195 }, 1196 )?; 1197 inst.func_wrap_concurrent( 1198 "list-s16-ret", 1199 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1200 let host = caller; 1201 let r = <G::Host as Host>::list_s16_ret(host); 1202 Box::pin(async move { 1203 let fun = r.await; 1204 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1205 let r = fun(caller); 1206 Ok((r,)) 1207 }) 1208 as Box< 1209 dyn FnOnce( 1210 wasmtime::StoreContextMut<'_, T>, 1211 ) -> wasmtime::Result< 1212 (wasmtime::component::__internal::Vec<i16>,), 1213 > + Send + Sync, 1214 > 1215 }) 1216 as ::core::pin::Pin< 1217 Box< 1218 dyn ::core::future::Future< 1219 Output = Box< 1220 dyn FnOnce( 1221 wasmtime::StoreContextMut<'_, T>, 1222 ) -> wasmtime::Result< 1223 (wasmtime::component::__internal::Vec<i16>,), 1224 > + Send + Sync, 1225 >, 1226 > + Send + Sync + 'static, 1227 >, 1228 > 1229 }, 1230 )?; 1231 inst.func_wrap_concurrent( 1232 "list-s32-ret", 1233 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1234 let host = caller; 1235 let r = <G::Host as Host>::list_s32_ret(host); 1236 Box::pin(async move { 1237 let fun = r.await; 1238 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1239 let r = fun(caller); 1240 Ok((r,)) 1241 }) 1242 as Box< 1243 dyn FnOnce( 1244 wasmtime::StoreContextMut<'_, T>, 1245 ) -> wasmtime::Result< 1246 (wasmtime::component::__internal::Vec<i32>,), 1247 > + Send + Sync, 1248 > 1249 }) 1250 as ::core::pin::Pin< 1251 Box< 1252 dyn ::core::future::Future< 1253 Output = Box< 1254 dyn FnOnce( 1255 wasmtime::StoreContextMut<'_, T>, 1256 ) -> wasmtime::Result< 1257 (wasmtime::component::__internal::Vec<i32>,), 1258 > + Send + Sync, 1259 >, 1260 > + Send + Sync + 'static, 1261 >, 1262 > 1263 }, 1264 )?; 1265 inst.func_wrap_concurrent( 1266 "list-s64-ret", 1267 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1268 let host = caller; 1269 let r = <G::Host as Host>::list_s64_ret(host); 1270 Box::pin(async move { 1271 let fun = r.await; 1272 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1273 let r = fun(caller); 1274 Ok((r,)) 1275 }) 1276 as Box< 1277 dyn FnOnce( 1278 wasmtime::StoreContextMut<'_, T>, 1279 ) -> wasmtime::Result< 1280 (wasmtime::component::__internal::Vec<i64>,), 1281 > + Send + Sync, 1282 > 1283 }) 1284 as ::core::pin::Pin< 1285 Box< 1286 dyn ::core::future::Future< 1287 Output = Box< 1288 dyn FnOnce( 1289 wasmtime::StoreContextMut<'_, T>, 1290 ) -> wasmtime::Result< 1291 (wasmtime::component::__internal::Vec<i64>,), 1292 > + Send + Sync, 1293 >, 1294 > + Send + Sync + 'static, 1295 >, 1296 > 1297 }, 1298 )?; 1299 inst.func_wrap_concurrent( 1300 "list-f32-ret", 1301 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1302 let host = caller; 1303 let r = <G::Host as Host>::list_f32_ret(host); 1304 Box::pin(async move { 1305 let fun = r.await; 1306 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1307 let r = fun(caller); 1308 Ok((r,)) 1309 }) 1310 as Box< 1311 dyn FnOnce( 1312 wasmtime::StoreContextMut<'_, T>, 1313 ) -> wasmtime::Result< 1314 (wasmtime::component::__internal::Vec<f32>,), 1315 > + Send + Sync, 1316 > 1317 }) 1318 as ::core::pin::Pin< 1319 Box< 1320 dyn ::core::future::Future< 1321 Output = Box< 1322 dyn FnOnce( 1323 wasmtime::StoreContextMut<'_, T>, 1324 ) -> wasmtime::Result< 1325 (wasmtime::component::__internal::Vec<f32>,), 1326 > + Send + Sync, 1327 >, 1328 > + Send + Sync + 'static, 1329 >, 1330 > 1331 }, 1332 )?; 1333 inst.func_wrap_concurrent( 1334 "list-f64-ret", 1335 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1336 let host = caller; 1337 let r = <G::Host as Host>::list_f64_ret(host); 1338 Box::pin(async move { 1339 let fun = r.await; 1340 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1341 let r = fun(caller); 1342 Ok((r,)) 1343 }) 1344 as Box< 1345 dyn FnOnce( 1346 wasmtime::StoreContextMut<'_, T>, 1347 ) -> wasmtime::Result< 1348 (wasmtime::component::__internal::Vec<f64>,), 1349 > + Send + Sync, 1350 > 1351 }) 1352 as ::core::pin::Pin< 1353 Box< 1354 dyn ::core::future::Future< 1355 Output = Box< 1356 dyn FnOnce( 1357 wasmtime::StoreContextMut<'_, T>, 1358 ) -> wasmtime::Result< 1359 (wasmtime::component::__internal::Vec<f64>,), 1360 > + Send + Sync, 1361 >, 1362 > + Send + Sync + 'static, 1363 >, 1364 > 1365 }, 1366 )?; 1367 inst.func_wrap_concurrent( 1368 "tuple-list", 1369 move | 1370 mut caller: wasmtime::StoreContextMut<'_, T>, 1371 (arg0,): (wasmtime::component::__internal::Vec<(u8, i8)>,)| 1372 { 1373 let host = caller; 1374 let r = <G::Host as Host>::tuple_list(host, arg0); 1375 Box::pin(async move { 1376 let fun = r.await; 1377 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1378 let r = fun(caller); 1379 Ok((r,)) 1380 }) 1381 as Box< 1382 dyn FnOnce( 1383 wasmtime::StoreContextMut<'_, T>, 1384 ) -> wasmtime::Result< 1385 (wasmtime::component::__internal::Vec<(i64, u32)>,), 1386 > + Send + Sync, 1387 > 1388 }) 1389 as ::core::pin::Pin< 1390 Box< 1391 dyn ::core::future::Future< 1392 Output = Box< 1393 dyn FnOnce( 1394 wasmtime::StoreContextMut<'_, T>, 1395 ) -> wasmtime::Result< 1396 (wasmtime::component::__internal::Vec<(i64, u32)>,), 1397 > + Send + Sync, 1398 >, 1399 > + Send + Sync + 'static, 1400 >, 1401 > 1402 }, 1403 )?; 1404 inst.func_wrap_concurrent( 1405 "string-list-arg", 1406 move | 1407 mut caller: wasmtime::StoreContextMut<'_, T>, 1408 ( 1409 arg0, 1410 ): ( 1411 wasmtime::component::__internal::Vec< 1412 wasmtime::component::__internal::String, 1413 >, 1414 )| 1415 { 1416 let host = caller; 1417 let r = <G::Host as Host>::string_list_arg(host, arg0); 1418 Box::pin(async move { 1419 let fun = r.await; 1420 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1421 let r = fun(caller); 1422 Ok(r) 1423 }) 1424 as Box< 1425 dyn FnOnce( 1426 wasmtime::StoreContextMut<'_, T>, 1427 ) -> wasmtime::Result<()> + Send + Sync, 1428 > 1429 }) 1430 as ::core::pin::Pin< 1431 Box< 1432 dyn ::core::future::Future< 1433 Output = Box< 1434 dyn FnOnce( 1435 wasmtime::StoreContextMut<'_, T>, 1436 ) -> wasmtime::Result<()> + Send + Sync, 1437 >, 1438 > + Send + Sync + 'static, 1439 >, 1440 > 1441 }, 1442 )?; 1443 inst.func_wrap_concurrent( 1444 "string-list-ret", 1445 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 1446 let host = caller; 1447 let r = <G::Host as Host>::string_list_ret(host); 1448 Box::pin(async move { 1449 let fun = r.await; 1450 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1451 let r = fun(caller); 1452 Ok((r,)) 1453 }) 1454 as Box< 1455 dyn FnOnce( 1456 wasmtime::StoreContextMut<'_, T>, 1457 ) -> wasmtime::Result< 1458 ( 1459 wasmtime::component::__internal::Vec< 1460 wasmtime::component::__internal::String, 1461 >, 1462 ), 1463 > + Send + Sync, 1464 > 1465 }) 1466 as ::core::pin::Pin< 1467 Box< 1468 dyn ::core::future::Future< 1469 Output = Box< 1470 dyn FnOnce( 1471 wasmtime::StoreContextMut<'_, T>, 1472 ) -> wasmtime::Result< 1473 ( 1474 wasmtime::component::__internal::Vec< 1475 wasmtime::component::__internal::String, 1476 >, 1477 ), 1478 > + Send + Sync, 1479 >, 1480 > + Send + Sync + 'static, 1481 >, 1482 > 1483 }, 1484 )?; 1485 inst.func_wrap_concurrent( 1486 "tuple-string-list", 1487 move | 1488 mut caller: wasmtime::StoreContextMut<'_, T>, 1489 ( 1490 arg0, 1491 ): ( 1492 wasmtime::component::__internal::Vec< 1493 (u8, wasmtime::component::__internal::String), 1494 >, 1495 )| 1496 { 1497 let host = caller; 1498 let r = <G::Host as Host>::tuple_string_list(host, arg0); 1499 Box::pin(async move { 1500 let fun = r.await; 1501 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1502 let r = fun(caller); 1503 Ok((r,)) 1504 }) 1505 as Box< 1506 dyn FnOnce( 1507 wasmtime::StoreContextMut<'_, T>, 1508 ) -> wasmtime::Result< 1509 ( 1510 wasmtime::component::__internal::Vec< 1511 (wasmtime::component::__internal::String, u8), 1512 >, 1513 ), 1514 > + Send + Sync, 1515 > 1516 }) 1517 as ::core::pin::Pin< 1518 Box< 1519 dyn ::core::future::Future< 1520 Output = Box< 1521 dyn FnOnce( 1522 wasmtime::StoreContextMut<'_, T>, 1523 ) -> wasmtime::Result< 1524 ( 1525 wasmtime::component::__internal::Vec< 1526 (wasmtime::component::__internal::String, u8), 1527 >, 1528 ), 1529 > + Send + Sync, 1530 >, 1531 > + Send + Sync + 'static, 1532 >, 1533 > 1534 }, 1535 )?; 1536 inst.func_wrap_concurrent( 1537 "string-list", 1538 move | 1539 mut caller: wasmtime::StoreContextMut<'_, T>, 1540 ( 1541 arg0, 1542 ): ( 1543 wasmtime::component::__internal::Vec< 1544 wasmtime::component::__internal::String, 1545 >, 1546 )| 1547 { 1548 let host = caller; 1549 let r = <G::Host as Host>::string_list(host, arg0); 1550 Box::pin(async move { 1551 let fun = r.await; 1552 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1553 let r = fun(caller); 1554 Ok((r,)) 1555 }) 1556 as Box< 1557 dyn FnOnce( 1558 wasmtime::StoreContextMut<'_, T>, 1559 ) -> wasmtime::Result< 1560 ( 1561 wasmtime::component::__internal::Vec< 1562 wasmtime::component::__internal::String, 1563 >, 1564 ), 1565 > + Send + Sync, 1566 > 1567 }) 1568 as ::core::pin::Pin< 1569 Box< 1570 dyn ::core::future::Future< 1571 Output = Box< 1572 dyn FnOnce( 1573 wasmtime::StoreContextMut<'_, T>, 1574 ) -> wasmtime::Result< 1575 ( 1576 wasmtime::component::__internal::Vec< 1577 wasmtime::component::__internal::String, 1578 >, 1579 ), 1580 > + Send + Sync, 1581 >, 1582 > + Send + Sync + 'static, 1583 >, 1584 > 1585 }, 1586 )?; 1587 inst.func_wrap_concurrent( 1588 "record-list", 1589 move | 1590 mut caller: wasmtime::StoreContextMut<'_, T>, 1591 (arg0,): (wasmtime::component::__internal::Vec<SomeRecord>,)| 1592 { 1593 let host = caller; 1594 let r = <G::Host as Host>::record_list(host, arg0); 1595 Box::pin(async move { 1596 let fun = r.await; 1597 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1598 let r = fun(caller); 1599 Ok((r,)) 1600 }) 1601 as Box< 1602 dyn FnOnce( 1603 wasmtime::StoreContextMut<'_, T>, 1604 ) -> wasmtime::Result< 1605 (wasmtime::component::__internal::Vec<OtherRecord>,), 1606 > + Send + Sync, 1607 > 1608 }) 1609 as ::core::pin::Pin< 1610 Box< 1611 dyn ::core::future::Future< 1612 Output = Box< 1613 dyn FnOnce( 1614 wasmtime::StoreContextMut<'_, T>, 1615 ) -> wasmtime::Result< 1616 (wasmtime::component::__internal::Vec<OtherRecord>,), 1617 > + Send + Sync, 1618 >, 1619 > + Send + Sync + 'static, 1620 >, 1621 > 1622 }, 1623 )?; 1624 inst.func_wrap_concurrent( 1625 "record-list-reverse", 1626 move | 1627 mut caller: wasmtime::StoreContextMut<'_, T>, 1628 (arg0,): (wasmtime::component::__internal::Vec<OtherRecord>,)| 1629 { 1630 let host = caller; 1631 let r = <G::Host as Host>::record_list_reverse(host, arg0); 1632 Box::pin(async move { 1633 let fun = r.await; 1634 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1635 let r = fun(caller); 1636 Ok((r,)) 1637 }) 1638 as Box< 1639 dyn FnOnce( 1640 wasmtime::StoreContextMut<'_, T>, 1641 ) -> wasmtime::Result< 1642 (wasmtime::component::__internal::Vec<SomeRecord>,), 1643 > + Send + Sync, 1644 > 1645 }) 1646 as ::core::pin::Pin< 1647 Box< 1648 dyn ::core::future::Future< 1649 Output = Box< 1650 dyn FnOnce( 1651 wasmtime::StoreContextMut<'_, T>, 1652 ) -> wasmtime::Result< 1653 (wasmtime::component::__internal::Vec<SomeRecord>,), 1654 > + Send + Sync, 1655 >, 1656 > + Send + Sync + 'static, 1657 >, 1658 > 1659 }, 1660 )?; 1661 inst.func_wrap_concurrent( 1662 "variant-list", 1663 move | 1664 mut caller: wasmtime::StoreContextMut<'_, T>, 1665 (arg0,): (wasmtime::component::__internal::Vec<SomeVariant>,)| 1666 { 1667 let host = caller; 1668 let r = <G::Host as Host>::variant_list(host, arg0); 1669 Box::pin(async move { 1670 let fun = r.await; 1671 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1672 let r = fun(caller); 1673 Ok((r,)) 1674 }) 1675 as Box< 1676 dyn FnOnce( 1677 wasmtime::StoreContextMut<'_, T>, 1678 ) -> wasmtime::Result< 1679 (wasmtime::component::__internal::Vec<OtherVariant>,), 1680 > + Send + Sync, 1681 > 1682 }) 1683 as ::core::pin::Pin< 1684 Box< 1685 dyn ::core::future::Future< 1686 Output = Box< 1687 dyn FnOnce( 1688 wasmtime::StoreContextMut<'_, T>, 1689 ) -> wasmtime::Result< 1690 (wasmtime::component::__internal::Vec<OtherVariant>,), 1691 > + Send + Sync, 1692 >, 1693 > + Send + Sync + 'static, 1694 >, 1695 > 1696 }, 1697 )?; 1698 inst.func_wrap_concurrent( 1699 "load-store-everything", 1700 move | 1701 mut caller: wasmtime::StoreContextMut<'_, T>, 1702 (arg0,): (LoadStoreAllSizes,)| 1703 { 1704 let host = caller; 1705 let r = <G::Host as Host>::load_store_everything(host, arg0); 1706 Box::pin(async move { 1707 let fun = r.await; 1708 Box::new(move |mut caller: wasmtime::StoreContextMut<'_, T>| { 1709 let r = fun(caller); 1710 Ok((r,)) 1711 }) 1712 as Box< 1713 dyn FnOnce( 1714 wasmtime::StoreContextMut<'_, T>, 1715 ) -> wasmtime::Result<(LoadStoreAllSizes,)> + Send + Sync, 1716 > 1717 }) 1718 as ::core::pin::Pin< 1719 Box< 1720 dyn ::core::future::Future< 1721 Output = Box< 1722 dyn FnOnce( 1723 wasmtime::StoreContextMut<'_, T>, 1724 ) -> wasmtime::Result<(LoadStoreAllSizes,)> + Send + Sync, 1725 >, 1726 > + Send + Sync + 'static, 1727 >, 1728 > 1729 }, 1730 )?; 1731 Ok(()) 1732 } 1733 pub fn add_to_linker<T, U>( 1734 linker: &mut wasmtime::component::Linker<T>, 1735 get: impl Fn(&mut T) -> &mut U + Send + Sync + Copy + 'static, 1736 ) -> wasmtime::Result<()> 1737 where 1738 U: Host<Data = T> + Send, 1739 T: Send + 'static, 1740 { 1741 add_to_linker_get_host(linker, get) 1742 } 1743 impl<_T: Host> Host for &mut _T { 1744 type Data = _T::Data; 1745 fn list_u8_param( 1746 store: wasmtime::StoreContextMut<'_, Self::Data>, 1747 x: wasmtime::component::__internal::Vec<u8>, 1748 ) -> impl ::core::future::Future< 1749 Output = impl FnOnce( 1750 wasmtime::StoreContextMut<'_, Self::Data>, 1751 ) -> () + Send + Sync + 'static, 1752 > + Send + Sync + 'static 1753 where 1754 Self: Sized, 1755 { 1756 <_T as Host>::list_u8_param(store, x) 1757 } 1758 fn list_u16_param( 1759 store: wasmtime::StoreContextMut<'_, Self::Data>, 1760 x: wasmtime::component::__internal::Vec<u16>, 1761 ) -> impl ::core::future::Future< 1762 Output = impl FnOnce( 1763 wasmtime::StoreContextMut<'_, Self::Data>, 1764 ) -> () + Send + Sync + 'static, 1765 > + Send + Sync + 'static 1766 where 1767 Self: Sized, 1768 { 1769 <_T as Host>::list_u16_param(store, x) 1770 } 1771 fn list_u32_param( 1772 store: wasmtime::StoreContextMut<'_, Self::Data>, 1773 x: wasmtime::component::__internal::Vec<u32>, 1774 ) -> impl ::core::future::Future< 1775 Output = impl FnOnce( 1776 wasmtime::StoreContextMut<'_, Self::Data>, 1777 ) -> () + Send + Sync + 'static, 1778 > + Send + Sync + 'static 1779 where 1780 Self: Sized, 1781 { 1782 <_T as Host>::list_u32_param(store, x) 1783 } 1784 fn list_u64_param( 1785 store: wasmtime::StoreContextMut<'_, Self::Data>, 1786 x: wasmtime::component::__internal::Vec<u64>, 1787 ) -> impl ::core::future::Future< 1788 Output = impl FnOnce( 1789 wasmtime::StoreContextMut<'_, Self::Data>, 1790 ) -> () + Send + Sync + 'static, 1791 > + Send + Sync + 'static 1792 where 1793 Self: Sized, 1794 { 1795 <_T as Host>::list_u64_param(store, x) 1796 } 1797 fn list_s8_param( 1798 store: wasmtime::StoreContextMut<'_, Self::Data>, 1799 x: wasmtime::component::__internal::Vec<i8>, 1800 ) -> impl ::core::future::Future< 1801 Output = impl FnOnce( 1802 wasmtime::StoreContextMut<'_, Self::Data>, 1803 ) -> () + Send + Sync + 'static, 1804 > + Send + Sync + 'static 1805 where 1806 Self: Sized, 1807 { 1808 <_T as Host>::list_s8_param(store, x) 1809 } 1810 fn list_s16_param( 1811 store: wasmtime::StoreContextMut<'_, Self::Data>, 1812 x: wasmtime::component::__internal::Vec<i16>, 1813 ) -> impl ::core::future::Future< 1814 Output = impl FnOnce( 1815 wasmtime::StoreContextMut<'_, Self::Data>, 1816 ) -> () + Send + Sync + 'static, 1817 > + Send + Sync + 'static 1818 where 1819 Self: Sized, 1820 { 1821 <_T as Host>::list_s16_param(store, x) 1822 } 1823 fn list_s32_param( 1824 store: wasmtime::StoreContextMut<'_, Self::Data>, 1825 x: wasmtime::component::__internal::Vec<i32>, 1826 ) -> impl ::core::future::Future< 1827 Output = impl FnOnce( 1828 wasmtime::StoreContextMut<'_, Self::Data>, 1829 ) -> () + Send + Sync + 'static, 1830 > + Send + Sync + 'static 1831 where 1832 Self: Sized, 1833 { 1834 <_T as Host>::list_s32_param(store, x) 1835 } 1836 fn list_s64_param( 1837 store: wasmtime::StoreContextMut<'_, Self::Data>, 1838 x: wasmtime::component::__internal::Vec<i64>, 1839 ) -> impl ::core::future::Future< 1840 Output = impl FnOnce( 1841 wasmtime::StoreContextMut<'_, Self::Data>, 1842 ) -> () + Send + Sync + 'static, 1843 > + Send + Sync + 'static 1844 where 1845 Self: Sized, 1846 { 1847 <_T as Host>::list_s64_param(store, x) 1848 } 1849 fn list_f32_param( 1850 store: wasmtime::StoreContextMut<'_, Self::Data>, 1851 x: wasmtime::component::__internal::Vec<f32>, 1852 ) -> impl ::core::future::Future< 1853 Output = impl FnOnce( 1854 wasmtime::StoreContextMut<'_, Self::Data>, 1855 ) -> () + Send + Sync + 'static, 1856 > + Send + Sync + 'static 1857 where 1858 Self: Sized, 1859 { 1860 <_T as Host>::list_f32_param(store, x) 1861 } 1862 fn list_f64_param( 1863 store: wasmtime::StoreContextMut<'_, Self::Data>, 1864 x: wasmtime::component::__internal::Vec<f64>, 1865 ) -> impl ::core::future::Future< 1866 Output = impl FnOnce( 1867 wasmtime::StoreContextMut<'_, Self::Data>, 1868 ) -> () + Send + Sync + 'static, 1869 > + Send + Sync + 'static 1870 where 1871 Self: Sized, 1872 { 1873 <_T as Host>::list_f64_param(store, x) 1874 } 1875 fn list_u8_ret( 1876 store: wasmtime::StoreContextMut<'_, Self::Data>, 1877 ) -> impl ::core::future::Future< 1878 Output = impl FnOnce( 1879 wasmtime::StoreContextMut<'_, Self::Data>, 1880 ) -> wasmtime::component::__internal::Vec<u8> + Send + Sync + 'static, 1881 > + Send + Sync + 'static 1882 where 1883 Self: Sized, 1884 { 1885 <_T as Host>::list_u8_ret(store) 1886 } 1887 fn list_u16_ret( 1888 store: wasmtime::StoreContextMut<'_, Self::Data>, 1889 ) -> impl ::core::future::Future< 1890 Output = impl FnOnce( 1891 wasmtime::StoreContextMut<'_, Self::Data>, 1892 ) -> wasmtime::component::__internal::Vec< 1893 u16, 1894 > + Send + Sync + 'static, 1895 > + Send + Sync + 'static 1896 where 1897 Self: Sized, 1898 { 1899 <_T as Host>::list_u16_ret(store) 1900 } 1901 fn list_u32_ret( 1902 store: wasmtime::StoreContextMut<'_, Self::Data>, 1903 ) -> impl ::core::future::Future< 1904 Output = impl FnOnce( 1905 wasmtime::StoreContextMut<'_, Self::Data>, 1906 ) -> wasmtime::component::__internal::Vec< 1907 u32, 1908 > + Send + Sync + 'static, 1909 > + Send + Sync + 'static 1910 where 1911 Self: Sized, 1912 { 1913 <_T as Host>::list_u32_ret(store) 1914 } 1915 fn list_u64_ret( 1916 store: wasmtime::StoreContextMut<'_, Self::Data>, 1917 ) -> impl ::core::future::Future< 1918 Output = impl FnOnce( 1919 wasmtime::StoreContextMut<'_, Self::Data>, 1920 ) -> wasmtime::component::__internal::Vec< 1921 u64, 1922 > + Send + Sync + 'static, 1923 > + Send + Sync + 'static 1924 where 1925 Self: Sized, 1926 { 1927 <_T as Host>::list_u64_ret(store) 1928 } 1929 fn list_s8_ret( 1930 store: wasmtime::StoreContextMut<'_, Self::Data>, 1931 ) -> impl ::core::future::Future< 1932 Output = impl FnOnce( 1933 wasmtime::StoreContextMut<'_, Self::Data>, 1934 ) -> wasmtime::component::__internal::Vec<i8> + Send + Sync + 'static, 1935 > + Send + Sync + 'static 1936 where 1937 Self: Sized, 1938 { 1939 <_T as Host>::list_s8_ret(store) 1940 } 1941 fn list_s16_ret( 1942 store: wasmtime::StoreContextMut<'_, Self::Data>, 1943 ) -> impl ::core::future::Future< 1944 Output = impl FnOnce( 1945 wasmtime::StoreContextMut<'_, Self::Data>, 1946 ) -> wasmtime::component::__internal::Vec< 1947 i16, 1948 > + Send + Sync + 'static, 1949 > + Send + Sync + 'static 1950 where 1951 Self: Sized, 1952 { 1953 <_T as Host>::list_s16_ret(store) 1954 } 1955 fn list_s32_ret( 1956 store: wasmtime::StoreContextMut<'_, Self::Data>, 1957 ) -> impl ::core::future::Future< 1958 Output = impl FnOnce( 1959 wasmtime::StoreContextMut<'_, Self::Data>, 1960 ) -> wasmtime::component::__internal::Vec< 1961 i32, 1962 > + Send + Sync + 'static, 1963 > + Send + Sync + 'static 1964 where 1965 Self: Sized, 1966 { 1967 <_T as Host>::list_s32_ret(store) 1968 } 1969 fn list_s64_ret( 1970 store: wasmtime::StoreContextMut<'_, Self::Data>, 1971 ) -> impl ::core::future::Future< 1972 Output = impl FnOnce( 1973 wasmtime::StoreContextMut<'_, Self::Data>, 1974 ) -> wasmtime::component::__internal::Vec< 1975 i64, 1976 > + Send + Sync + 'static, 1977 > + Send + Sync + 'static 1978 where 1979 Self: Sized, 1980 { 1981 <_T as Host>::list_s64_ret(store) 1982 } 1983 fn list_f32_ret( 1984 store: wasmtime::StoreContextMut<'_, Self::Data>, 1985 ) -> impl ::core::future::Future< 1986 Output = impl FnOnce( 1987 wasmtime::StoreContextMut<'_, Self::Data>, 1988 ) -> wasmtime::component::__internal::Vec< 1989 f32, 1990 > + Send + Sync + 'static, 1991 > + Send + Sync + 'static 1992 where 1993 Self: Sized, 1994 { 1995 <_T as Host>::list_f32_ret(store) 1996 } 1997 fn list_f64_ret( 1998 store: wasmtime::StoreContextMut<'_, Self::Data>, 1999 ) -> impl ::core::future::Future< 2000 Output = impl FnOnce( 2001 wasmtime::StoreContextMut<'_, Self::Data>, 2002 ) -> wasmtime::component::__internal::Vec< 2003 f64, 2004 > + Send + Sync + 'static, 2005 > + Send + Sync + 'static 2006 where 2007 Self: Sized, 2008 { 2009 <_T as Host>::list_f64_ret(store) 2010 } 2011 fn tuple_list( 2012 store: wasmtime::StoreContextMut<'_, Self::Data>, 2013 x: wasmtime::component::__internal::Vec<(u8, i8)>, 2014 ) -> impl ::core::future::Future< 2015 Output = impl FnOnce( 2016 wasmtime::StoreContextMut<'_, Self::Data>, 2017 ) -> wasmtime::component::__internal::Vec< 2018 (i64, u32), 2019 > + Send + Sync + 'static, 2020 > + Send + Sync + 'static 2021 where 2022 Self: Sized, 2023 { 2024 <_T as Host>::tuple_list(store, x) 2025 } 2026 fn string_list_arg( 2027 store: wasmtime::StoreContextMut<'_, Self::Data>, 2028 a: wasmtime::component::__internal::Vec< 2029 wasmtime::component::__internal::String, 2030 >, 2031 ) -> impl ::core::future::Future< 2032 Output = impl FnOnce( 2033 wasmtime::StoreContextMut<'_, Self::Data>, 2034 ) -> () + Send + Sync + 'static, 2035 > + Send + Sync + 'static 2036 where 2037 Self: Sized, 2038 { 2039 <_T as Host>::string_list_arg(store, a) 2040 } 2041 fn string_list_ret( 2042 store: wasmtime::StoreContextMut<'_, Self::Data>, 2043 ) -> impl ::core::future::Future< 2044 Output = impl FnOnce( 2045 wasmtime::StoreContextMut<'_, Self::Data>, 2046 ) -> wasmtime::component::__internal::Vec< 2047 wasmtime::component::__internal::String, 2048 > + Send + Sync + 'static, 2049 > + Send + Sync + 'static 2050 where 2051 Self: Sized, 2052 { 2053 <_T as Host>::string_list_ret(store) 2054 } 2055 fn tuple_string_list( 2056 store: wasmtime::StoreContextMut<'_, Self::Data>, 2057 x: wasmtime::component::__internal::Vec< 2058 (u8, wasmtime::component::__internal::String), 2059 >, 2060 ) -> impl ::core::future::Future< 2061 Output = impl FnOnce( 2062 wasmtime::StoreContextMut<'_, Self::Data>, 2063 ) -> wasmtime::component::__internal::Vec< 2064 (wasmtime::component::__internal::String, u8), 2065 > + Send + Sync + 'static, 2066 > + Send + Sync + 'static 2067 where 2068 Self: Sized, 2069 { 2070 <_T as Host>::tuple_string_list(store, x) 2071 } 2072 fn string_list( 2073 store: wasmtime::StoreContextMut<'_, Self::Data>, 2074 x: wasmtime::component::__internal::Vec< 2075 wasmtime::component::__internal::String, 2076 >, 2077 ) -> impl ::core::future::Future< 2078 Output = impl FnOnce( 2079 wasmtime::StoreContextMut<'_, Self::Data>, 2080 ) -> wasmtime::component::__internal::Vec< 2081 wasmtime::component::__internal::String, 2082 > + Send + Sync + 'static, 2083 > + Send + Sync + 'static 2084 where 2085 Self: Sized, 2086 { 2087 <_T as Host>::string_list(store, x) 2088 } 2089 fn record_list( 2090 store: wasmtime::StoreContextMut<'_, Self::Data>, 2091 x: wasmtime::component::__internal::Vec<SomeRecord>, 2092 ) -> impl ::core::future::Future< 2093 Output = impl FnOnce( 2094 wasmtime::StoreContextMut<'_, Self::Data>, 2095 ) -> wasmtime::component::__internal::Vec< 2096 OtherRecord, 2097 > + Send + Sync + 'static, 2098 > + Send + Sync + 'static 2099 where 2100 Self: Sized, 2101 { 2102 <_T as Host>::record_list(store, x) 2103 } 2104 fn record_list_reverse( 2105 store: wasmtime::StoreContextMut<'_, Self::Data>, 2106 x: wasmtime::component::__internal::Vec<OtherRecord>, 2107 ) -> impl ::core::future::Future< 2108 Output = impl FnOnce( 2109 wasmtime::StoreContextMut<'_, Self::Data>, 2110 ) -> wasmtime::component::__internal::Vec< 2111 SomeRecord, 2112 > + Send + Sync + 'static, 2113 > + Send + Sync + 'static 2114 where 2115 Self: Sized, 2116 { 2117 <_T as Host>::record_list_reverse(store, x) 2118 } 2119 fn variant_list( 2120 store: wasmtime::StoreContextMut<'_, Self::Data>, 2121 x: wasmtime::component::__internal::Vec<SomeVariant>, 2122 ) -> impl ::core::future::Future< 2123 Output = impl FnOnce( 2124 wasmtime::StoreContextMut<'_, Self::Data>, 2125 ) -> wasmtime::component::__internal::Vec< 2126 OtherVariant, 2127 > + Send + Sync + 'static, 2128 > + Send + Sync + 'static 2129 where 2130 Self: Sized, 2131 { 2132 <_T as Host>::variant_list(store, x) 2133 } 2134 fn load_store_everything( 2135 store: wasmtime::StoreContextMut<'_, Self::Data>, 2136 a: LoadStoreAllSizes, 2137 ) -> impl ::core::future::Future< 2138 Output = impl FnOnce( 2139 wasmtime::StoreContextMut<'_, Self::Data>, 2140 ) -> LoadStoreAllSizes + Send + Sync + 'static, 2141 > + Send + Sync + 'static 2142 where 2143 Self: Sized, 2144 { 2145 <_T as Host>::load_store_everything(store, a) 2146 } 2147 } 2148 } 2149 } 2150 } 2151 pub mod exports { 2152 pub mod foo { 2153 pub mod foo { 2154 #[allow(clippy::all)] 2155 pub mod lists { 2156 #[allow(unused_imports)] 2157 use wasmtime::component::__internal::{anyhow, Box}; 2158 #[derive(wasmtime::component::ComponentType)] 2159 #[derive(wasmtime::component::Lift)] 2160 #[derive(wasmtime::component::Lower)] 2161 #[component(record)] 2162 #[derive(Clone)] 2163 pub struct OtherRecord { 2164 #[component(name = "a1")] 2165 pub a1: u32, 2166 #[component(name = "a2")] 2167 pub a2: u64, 2168 #[component(name = "a3")] 2169 pub a3: i32, 2170 #[component(name = "a4")] 2171 pub a4: i64, 2172 #[component(name = "b")] 2173 pub b: wasmtime::component::__internal::String, 2174 #[component(name = "c")] 2175 pub c: wasmtime::component::__internal::Vec<u8>, 2176 } 2177 impl core::fmt::Debug for OtherRecord { 2178 fn fmt( 2179 &self, 2180 f: &mut core::fmt::Formatter<'_>, 2181 ) -> core::fmt::Result { 2182 f.debug_struct("OtherRecord") 2183 .field("a1", &self.a1) 2184 .field("a2", &self.a2) 2185 .field("a3", &self.a3) 2186 .field("a4", &self.a4) 2187 .field("b", &self.b) 2188 .field("c", &self.c) 2189 .finish() 2190 } 2191 } 2192 const _: () = { 2193 assert!( 2194 48 == < OtherRecord as wasmtime::component::ComponentType 2195 >::SIZE32 2196 ); 2197 assert!( 2198 8 == < OtherRecord as wasmtime::component::ComponentType 2199 >::ALIGN32 2200 ); 2201 }; 2202 #[derive(wasmtime::component::ComponentType)] 2203 #[derive(wasmtime::component::Lift)] 2204 #[derive(wasmtime::component::Lower)] 2205 #[component(record)] 2206 #[derive(Clone)] 2207 pub struct SomeRecord { 2208 #[component(name = "x")] 2209 pub x: wasmtime::component::__internal::String, 2210 #[component(name = "y")] 2211 pub y: OtherRecord, 2212 #[component(name = "z")] 2213 pub z: wasmtime::component::__internal::Vec<OtherRecord>, 2214 #[component(name = "c1")] 2215 pub c1: u32, 2216 #[component(name = "c2")] 2217 pub c2: u64, 2218 #[component(name = "c3")] 2219 pub c3: i32, 2220 #[component(name = "c4")] 2221 pub c4: i64, 2222 } 2223 impl core::fmt::Debug for SomeRecord { 2224 fn fmt( 2225 &self, 2226 f: &mut core::fmt::Formatter<'_>, 2227 ) -> core::fmt::Result { 2228 f.debug_struct("SomeRecord") 2229 .field("x", &self.x) 2230 .field("y", &self.y) 2231 .field("z", &self.z) 2232 .field("c1", &self.c1) 2233 .field("c2", &self.c2) 2234 .field("c3", &self.c3) 2235 .field("c4", &self.c4) 2236 .finish() 2237 } 2238 } 2239 const _: () = { 2240 assert!( 2241 96 == < SomeRecord as wasmtime::component::ComponentType 2242 >::SIZE32 2243 ); 2244 assert!( 2245 8 == < SomeRecord as wasmtime::component::ComponentType 2246 >::ALIGN32 2247 ); 2248 }; 2249 #[derive(wasmtime::component::ComponentType)] 2250 #[derive(wasmtime::component::Lift)] 2251 #[derive(wasmtime::component::Lower)] 2252 #[component(variant)] 2253 #[derive(Clone)] 2254 pub enum OtherVariant { 2255 #[component(name = "a")] 2256 A, 2257 #[component(name = "b")] 2258 B(u32), 2259 #[component(name = "c")] 2260 C(wasmtime::component::__internal::String), 2261 } 2262 impl core::fmt::Debug for OtherVariant { 2263 fn fmt( 2264 &self, 2265 f: &mut core::fmt::Formatter<'_>, 2266 ) -> core::fmt::Result { 2267 match self { 2268 OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(), 2269 OtherVariant::B(e) => { 2270 f.debug_tuple("OtherVariant::B").field(e).finish() 2271 } 2272 OtherVariant::C(e) => { 2273 f.debug_tuple("OtherVariant::C").field(e).finish() 2274 } 2275 } 2276 } 2277 } 2278 const _: () = { 2279 assert!( 2280 12 == < OtherVariant as wasmtime::component::ComponentType 2281 >::SIZE32 2282 ); 2283 assert!( 2284 4 == < OtherVariant as wasmtime::component::ComponentType 2285 >::ALIGN32 2286 ); 2287 }; 2288 #[derive(wasmtime::component::ComponentType)] 2289 #[derive(wasmtime::component::Lift)] 2290 #[derive(wasmtime::component::Lower)] 2291 #[component(variant)] 2292 #[derive(Clone)] 2293 pub enum SomeVariant { 2294 #[component(name = "a")] 2295 A(wasmtime::component::__internal::String), 2296 #[component(name = "b")] 2297 B, 2298 #[component(name = "c")] 2299 C(u32), 2300 #[component(name = "d")] 2301 D(wasmtime::component::__internal::Vec<OtherVariant>), 2302 } 2303 impl core::fmt::Debug for SomeVariant { 2304 fn fmt( 2305 &self, 2306 f: &mut core::fmt::Formatter<'_>, 2307 ) -> core::fmt::Result { 2308 match self { 2309 SomeVariant::A(e) => { 2310 f.debug_tuple("SomeVariant::A").field(e).finish() 2311 } 2312 SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(), 2313 SomeVariant::C(e) => { 2314 f.debug_tuple("SomeVariant::C").field(e).finish() 2315 } 2316 SomeVariant::D(e) => { 2317 f.debug_tuple("SomeVariant::D").field(e).finish() 2318 } 2319 } 2320 } 2321 } 2322 const _: () = { 2323 assert!( 2324 12 == < SomeVariant as wasmtime::component::ComponentType 2325 >::SIZE32 2326 ); 2327 assert!( 2328 4 == < SomeVariant as wasmtime::component::ComponentType 2329 >::ALIGN32 2330 ); 2331 }; 2332 pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec< 2333 ( 2334 wasmtime::component::__internal::String, 2335 u8, 2336 i8, 2337 u16, 2338 i16, 2339 u32, 2340 i32, 2341 u64, 2342 i64, 2343 f32, 2344 f64, 2345 char, 2346 ), 2347 >; 2348 const _: () = { 2349 assert!( 2350 8 == < LoadStoreAllSizes as wasmtime::component::ComponentType 2351 >::SIZE32 2352 ); 2353 assert!( 2354 4 == < LoadStoreAllSizes as wasmtime::component::ComponentType 2355 >::ALIGN32 2356 ); 2357 }; 2358 pub struct Guest { 2359 list_u8_param: wasmtime::component::Func, 2360 list_u16_param: wasmtime::component::Func, 2361 list_u32_param: wasmtime::component::Func, 2362 list_u64_param: wasmtime::component::Func, 2363 list_s8_param: wasmtime::component::Func, 2364 list_s16_param: wasmtime::component::Func, 2365 list_s32_param: wasmtime::component::Func, 2366 list_s64_param: wasmtime::component::Func, 2367 list_f32_param: wasmtime::component::Func, 2368 list_f64_param: wasmtime::component::Func, 2369 list_u8_ret: wasmtime::component::Func, 2370 list_u16_ret: wasmtime::component::Func, 2371 list_u32_ret: wasmtime::component::Func, 2372 list_u64_ret: wasmtime::component::Func, 2373 list_s8_ret: wasmtime::component::Func, 2374 list_s16_ret: wasmtime::component::Func, 2375 list_s32_ret: wasmtime::component::Func, 2376 list_s64_ret: wasmtime::component::Func, 2377 list_f32_ret: wasmtime::component::Func, 2378 list_f64_ret: wasmtime::component::Func, 2379 tuple_list: wasmtime::component::Func, 2380 string_list_arg: wasmtime::component::Func, 2381 string_list_ret: wasmtime::component::Func, 2382 tuple_string_list: wasmtime::component::Func, 2383 string_list: wasmtime::component::Func, 2384 record_list: wasmtime::component::Func, 2385 record_list_reverse: wasmtime::component::Func, 2386 variant_list: wasmtime::component::Func, 2387 load_store_everything: wasmtime::component::Func, 2388 } 2389 #[derive(Clone)] 2390 pub struct GuestIndices { 2391 list_u8_param: wasmtime::component::ComponentExportIndex, 2392 list_u16_param: wasmtime::component::ComponentExportIndex, 2393 list_u32_param: wasmtime::component::ComponentExportIndex, 2394 list_u64_param: wasmtime::component::ComponentExportIndex, 2395 list_s8_param: wasmtime::component::ComponentExportIndex, 2396 list_s16_param: wasmtime::component::ComponentExportIndex, 2397 list_s32_param: wasmtime::component::ComponentExportIndex, 2398 list_s64_param: wasmtime::component::ComponentExportIndex, 2399 list_f32_param: wasmtime::component::ComponentExportIndex, 2400 list_f64_param: wasmtime::component::ComponentExportIndex, 2401 list_u8_ret: wasmtime::component::ComponentExportIndex, 2402 list_u16_ret: wasmtime::component::ComponentExportIndex, 2403 list_u32_ret: wasmtime::component::ComponentExportIndex, 2404 list_u64_ret: wasmtime::component::ComponentExportIndex, 2405 list_s8_ret: wasmtime::component::ComponentExportIndex, 2406 list_s16_ret: wasmtime::component::ComponentExportIndex, 2407 list_s32_ret: wasmtime::component::ComponentExportIndex, 2408 list_s64_ret: wasmtime::component::ComponentExportIndex, 2409 list_f32_ret: wasmtime::component::ComponentExportIndex, 2410 list_f64_ret: wasmtime::component::ComponentExportIndex, 2411 tuple_list: wasmtime::component::ComponentExportIndex, 2412 string_list_arg: wasmtime::component::ComponentExportIndex, 2413 string_list_ret: wasmtime::component::ComponentExportIndex, 2414 tuple_string_list: wasmtime::component::ComponentExportIndex, 2415 string_list: wasmtime::component::ComponentExportIndex, 2416 record_list: wasmtime::component::ComponentExportIndex, 2417 record_list_reverse: wasmtime::component::ComponentExportIndex, 2418 variant_list: wasmtime::component::ComponentExportIndex, 2419 load_store_everything: wasmtime::component::ComponentExportIndex, 2420 } 2421 impl GuestIndices { 2422 /// Constructor for [`GuestIndices`] which takes a 2423 /// [`Component`](wasmtime::component::Component) as input and can be executed 2424 /// before instantiation. 2425 /// 2426 /// This constructor can be used to front-load string lookups to find exports 2427 /// within a component. 2428 pub fn new<_T>( 2429 _instance_pre: &wasmtime::component::InstancePre<_T>, 2430 ) -> wasmtime::Result<GuestIndices> { 2431 let instance = _instance_pre 2432 .component() 2433 .get_export_index(None, "foo:foo/lists") 2434 .ok_or_else(|| { 2435 anyhow::anyhow!( 2436 "no exported instance named `foo:foo/lists`" 2437 ) 2438 })?; 2439 let mut lookup = move |name| { 2440 _instance_pre 2441 .component() 2442 .get_export_index(Some(&instance), name) 2443 .ok_or_else(|| { 2444 anyhow::anyhow!( 2445 "instance export `foo:foo/lists` does \ 2446 not have export `{name}`" 2447 ) 2448 }) 2449 }; 2450 let _ = &mut lookup; 2451 let list_u8_param = lookup("list-u8-param")?; 2452 let list_u16_param = lookup("list-u16-param")?; 2453 let list_u32_param = lookup("list-u32-param")?; 2454 let list_u64_param = lookup("list-u64-param")?; 2455 let list_s8_param = lookup("list-s8-param")?; 2456 let list_s16_param = lookup("list-s16-param")?; 2457 let list_s32_param = lookup("list-s32-param")?; 2458 let list_s64_param = lookup("list-s64-param")?; 2459 let list_f32_param = lookup("list-f32-param")?; 2460 let list_f64_param = lookup("list-f64-param")?; 2461 let list_u8_ret = lookup("list-u8-ret")?; 2462 let list_u16_ret = lookup("list-u16-ret")?; 2463 let list_u32_ret = lookup("list-u32-ret")?; 2464 let list_u64_ret = lookup("list-u64-ret")?; 2465 let list_s8_ret = lookup("list-s8-ret")?; 2466 let list_s16_ret = lookup("list-s16-ret")?; 2467 let list_s32_ret = lookup("list-s32-ret")?; 2468 let list_s64_ret = lookup("list-s64-ret")?; 2469 let list_f32_ret = lookup("list-f32-ret")?; 2470 let list_f64_ret = lookup("list-f64-ret")?; 2471 let tuple_list = lookup("tuple-list")?; 2472 let string_list_arg = lookup("string-list-arg")?; 2473 let string_list_ret = lookup("string-list-ret")?; 2474 let tuple_string_list = lookup("tuple-string-list")?; 2475 let string_list = lookup("string-list")?; 2476 let record_list = lookup("record-list")?; 2477 let record_list_reverse = lookup("record-list-reverse")?; 2478 let variant_list = lookup("variant-list")?; 2479 let load_store_everything = lookup("load-store-everything")?; 2480 Ok(GuestIndices { 2481 list_u8_param, 2482 list_u16_param, 2483 list_u32_param, 2484 list_u64_param, 2485 list_s8_param, 2486 list_s16_param, 2487 list_s32_param, 2488 list_s64_param, 2489 list_f32_param, 2490 list_f64_param, 2491 list_u8_ret, 2492 list_u16_ret, 2493 list_u32_ret, 2494 list_u64_ret, 2495 list_s8_ret, 2496 list_s16_ret, 2497 list_s32_ret, 2498 list_s64_ret, 2499 list_f32_ret, 2500 list_f64_ret, 2501 tuple_list, 2502 string_list_arg, 2503 string_list_ret, 2504 tuple_string_list, 2505 string_list, 2506 record_list, 2507 record_list_reverse, 2508 variant_list, 2509 load_store_everything, 2510 }) 2511 } 2512 pub fn load( 2513 &self, 2514 mut store: impl wasmtime::AsContextMut, 2515 instance: &wasmtime::component::Instance, 2516 ) -> wasmtime::Result<Guest> { 2517 let _instance = instance; 2518 let _instance_pre = _instance.instance_pre(&store); 2519 let _instance_type = _instance_pre.instance_type(); 2520 let mut store = store.as_context_mut(); 2521 let _ = &mut store; 2522 let list_u8_param = *_instance 2523 .get_typed_func::< 2524 (&[u8],), 2525 (), 2526 >(&mut store, &self.list_u8_param)? 2527 .func(); 2528 let list_u16_param = *_instance 2529 .get_typed_func::< 2530 (&[u16],), 2531 (), 2532 >(&mut store, &self.list_u16_param)? 2533 .func(); 2534 let list_u32_param = *_instance 2535 .get_typed_func::< 2536 (&[u32],), 2537 (), 2538 >(&mut store, &self.list_u32_param)? 2539 .func(); 2540 let list_u64_param = *_instance 2541 .get_typed_func::< 2542 (&[u64],), 2543 (), 2544 >(&mut store, &self.list_u64_param)? 2545 .func(); 2546 let list_s8_param = *_instance 2547 .get_typed_func::< 2548 (&[i8],), 2549 (), 2550 >(&mut store, &self.list_s8_param)? 2551 .func(); 2552 let list_s16_param = *_instance 2553 .get_typed_func::< 2554 (&[i16],), 2555 (), 2556 >(&mut store, &self.list_s16_param)? 2557 .func(); 2558 let list_s32_param = *_instance 2559 .get_typed_func::< 2560 (&[i32],), 2561 (), 2562 >(&mut store, &self.list_s32_param)? 2563 .func(); 2564 let list_s64_param = *_instance 2565 .get_typed_func::< 2566 (&[i64],), 2567 (), 2568 >(&mut store, &self.list_s64_param)? 2569 .func(); 2570 let list_f32_param = *_instance 2571 .get_typed_func::< 2572 (&[f32],), 2573 (), 2574 >(&mut store, &self.list_f32_param)? 2575 .func(); 2576 let list_f64_param = *_instance 2577 .get_typed_func::< 2578 (&[f64],), 2579 (), 2580 >(&mut store, &self.list_f64_param)? 2581 .func(); 2582 let list_u8_ret = *_instance 2583 .get_typed_func::< 2584 (), 2585 (wasmtime::component::__internal::Vec<u8>,), 2586 >(&mut store, &self.list_u8_ret)? 2587 .func(); 2588 let list_u16_ret = *_instance 2589 .get_typed_func::< 2590 (), 2591 (wasmtime::component::__internal::Vec<u16>,), 2592 >(&mut store, &self.list_u16_ret)? 2593 .func(); 2594 let list_u32_ret = *_instance 2595 .get_typed_func::< 2596 (), 2597 (wasmtime::component::__internal::Vec<u32>,), 2598 >(&mut store, &self.list_u32_ret)? 2599 .func(); 2600 let list_u64_ret = *_instance 2601 .get_typed_func::< 2602 (), 2603 (wasmtime::component::__internal::Vec<u64>,), 2604 >(&mut store, &self.list_u64_ret)? 2605 .func(); 2606 let list_s8_ret = *_instance 2607 .get_typed_func::< 2608 (), 2609 (wasmtime::component::__internal::Vec<i8>,), 2610 >(&mut store, &self.list_s8_ret)? 2611 .func(); 2612 let list_s16_ret = *_instance 2613 .get_typed_func::< 2614 (), 2615 (wasmtime::component::__internal::Vec<i16>,), 2616 >(&mut store, &self.list_s16_ret)? 2617 .func(); 2618 let list_s32_ret = *_instance 2619 .get_typed_func::< 2620 (), 2621 (wasmtime::component::__internal::Vec<i32>,), 2622 >(&mut store, &self.list_s32_ret)? 2623 .func(); 2624 let list_s64_ret = *_instance 2625 .get_typed_func::< 2626 (), 2627 (wasmtime::component::__internal::Vec<i64>,), 2628 >(&mut store, &self.list_s64_ret)? 2629 .func(); 2630 let list_f32_ret = *_instance 2631 .get_typed_func::< 2632 (), 2633 (wasmtime::component::__internal::Vec<f32>,), 2634 >(&mut store, &self.list_f32_ret)? 2635 .func(); 2636 let list_f64_ret = *_instance 2637 .get_typed_func::< 2638 (), 2639 (wasmtime::component::__internal::Vec<f64>,), 2640 >(&mut store, &self.list_f64_ret)? 2641 .func(); 2642 let tuple_list = *_instance 2643 .get_typed_func::< 2644 (&[(u8, i8)],), 2645 (wasmtime::component::__internal::Vec<(i64, u32)>,), 2646 >(&mut store, &self.tuple_list)? 2647 .func(); 2648 let string_list_arg = *_instance 2649 .get_typed_func::< 2650 (&[wasmtime::component::__internal::String],), 2651 (), 2652 >(&mut store, &self.string_list_arg)? 2653 .func(); 2654 let string_list_ret = *_instance 2655 .get_typed_func::< 2656 (), 2657 ( 2658 wasmtime::component::__internal::Vec< 2659 wasmtime::component::__internal::String, 2660 >, 2661 ), 2662 >(&mut store, &self.string_list_ret)? 2663 .func(); 2664 let tuple_string_list = *_instance 2665 .get_typed_func::< 2666 (&[(u8, wasmtime::component::__internal::String)],), 2667 ( 2668 wasmtime::component::__internal::Vec< 2669 (wasmtime::component::__internal::String, u8), 2670 >, 2671 ), 2672 >(&mut store, &self.tuple_string_list)? 2673 .func(); 2674 let string_list = *_instance 2675 .get_typed_func::< 2676 (&[wasmtime::component::__internal::String],), 2677 ( 2678 wasmtime::component::__internal::Vec< 2679 wasmtime::component::__internal::String, 2680 >, 2681 ), 2682 >(&mut store, &self.string_list)? 2683 .func(); 2684 let record_list = *_instance 2685 .get_typed_func::< 2686 (&[SomeRecord],), 2687 (wasmtime::component::__internal::Vec<OtherRecord>,), 2688 >(&mut store, &self.record_list)? 2689 .func(); 2690 let record_list_reverse = *_instance 2691 .get_typed_func::< 2692 (&[OtherRecord],), 2693 (wasmtime::component::__internal::Vec<SomeRecord>,), 2694 >(&mut store, &self.record_list_reverse)? 2695 .func(); 2696 let variant_list = *_instance 2697 .get_typed_func::< 2698 (&[SomeVariant],), 2699 (wasmtime::component::__internal::Vec<OtherVariant>,), 2700 >(&mut store, &self.variant_list)? 2701 .func(); 2702 let load_store_everything = *_instance 2703 .get_typed_func::< 2704 (&LoadStoreAllSizes,), 2705 (LoadStoreAllSizes,), 2706 >(&mut store, &self.load_store_everything)? 2707 .func(); 2708 Ok(Guest { 2709 list_u8_param, 2710 list_u16_param, 2711 list_u32_param, 2712 list_u64_param, 2713 list_s8_param, 2714 list_s16_param, 2715 list_s32_param, 2716 list_s64_param, 2717 list_f32_param, 2718 list_f64_param, 2719 list_u8_ret, 2720 list_u16_ret, 2721 list_u32_ret, 2722 list_u64_ret, 2723 list_s8_ret, 2724 list_s16_ret, 2725 list_s32_ret, 2726 list_s64_ret, 2727 list_f32_ret, 2728 list_f64_ret, 2729 tuple_list, 2730 string_list_arg, 2731 string_list_ret, 2732 tuple_string_list, 2733 string_list, 2734 record_list, 2735 record_list_reverse, 2736 variant_list, 2737 load_store_everything, 2738 }) 2739 } 2740 } 2741 impl Guest { 2742 pub async fn call_list_u8_param<S: wasmtime::AsContextMut>( 2743 &self, 2744 mut store: S, 2745 arg0: wasmtime::component::__internal::Vec<u8>, 2746 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2747 where 2748 <S as wasmtime::AsContext>::Data: Send + 'static, 2749 { 2750 let callee = unsafe { 2751 wasmtime::component::TypedFunc::< 2752 (wasmtime::component::__internal::Vec<u8>,), 2753 (), 2754 >::new_unchecked(self.list_u8_param) 2755 }; 2756 let promise = callee 2757 .call_concurrent(store.as_context_mut(), (arg0,)) 2758 .await?; 2759 Ok(promise) 2760 } 2761 pub async fn call_list_u16_param<S: wasmtime::AsContextMut>( 2762 &self, 2763 mut store: S, 2764 arg0: wasmtime::component::__internal::Vec<u16>, 2765 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2766 where 2767 <S as wasmtime::AsContext>::Data: Send + 'static, 2768 { 2769 let callee = unsafe { 2770 wasmtime::component::TypedFunc::< 2771 (wasmtime::component::__internal::Vec<u16>,), 2772 (), 2773 >::new_unchecked(self.list_u16_param) 2774 }; 2775 let promise = callee 2776 .call_concurrent(store.as_context_mut(), (arg0,)) 2777 .await?; 2778 Ok(promise) 2779 } 2780 pub async fn call_list_u32_param<S: wasmtime::AsContextMut>( 2781 &self, 2782 mut store: S, 2783 arg0: wasmtime::component::__internal::Vec<u32>, 2784 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2785 where 2786 <S as wasmtime::AsContext>::Data: Send + 'static, 2787 { 2788 let callee = unsafe { 2789 wasmtime::component::TypedFunc::< 2790 (wasmtime::component::__internal::Vec<u32>,), 2791 (), 2792 >::new_unchecked(self.list_u32_param) 2793 }; 2794 let promise = callee 2795 .call_concurrent(store.as_context_mut(), (arg0,)) 2796 .await?; 2797 Ok(promise) 2798 } 2799 pub async fn call_list_u64_param<S: wasmtime::AsContextMut>( 2800 &self, 2801 mut store: S, 2802 arg0: wasmtime::component::__internal::Vec<u64>, 2803 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2804 where 2805 <S as wasmtime::AsContext>::Data: Send + 'static, 2806 { 2807 let callee = unsafe { 2808 wasmtime::component::TypedFunc::< 2809 (wasmtime::component::__internal::Vec<u64>,), 2810 (), 2811 >::new_unchecked(self.list_u64_param) 2812 }; 2813 let promise = callee 2814 .call_concurrent(store.as_context_mut(), (arg0,)) 2815 .await?; 2816 Ok(promise) 2817 } 2818 pub async fn call_list_s8_param<S: wasmtime::AsContextMut>( 2819 &self, 2820 mut store: S, 2821 arg0: wasmtime::component::__internal::Vec<i8>, 2822 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2823 where 2824 <S as wasmtime::AsContext>::Data: Send + 'static, 2825 { 2826 let callee = unsafe { 2827 wasmtime::component::TypedFunc::< 2828 (wasmtime::component::__internal::Vec<i8>,), 2829 (), 2830 >::new_unchecked(self.list_s8_param) 2831 }; 2832 let promise = callee 2833 .call_concurrent(store.as_context_mut(), (arg0,)) 2834 .await?; 2835 Ok(promise) 2836 } 2837 pub async fn call_list_s16_param<S: wasmtime::AsContextMut>( 2838 &self, 2839 mut store: S, 2840 arg0: wasmtime::component::__internal::Vec<i16>, 2841 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2842 where 2843 <S as wasmtime::AsContext>::Data: Send + 'static, 2844 { 2845 let callee = unsafe { 2846 wasmtime::component::TypedFunc::< 2847 (wasmtime::component::__internal::Vec<i16>,), 2848 (), 2849 >::new_unchecked(self.list_s16_param) 2850 }; 2851 let promise = callee 2852 .call_concurrent(store.as_context_mut(), (arg0,)) 2853 .await?; 2854 Ok(promise) 2855 } 2856 pub async fn call_list_s32_param<S: wasmtime::AsContextMut>( 2857 &self, 2858 mut store: S, 2859 arg0: wasmtime::component::__internal::Vec<i32>, 2860 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2861 where 2862 <S as wasmtime::AsContext>::Data: Send + 'static, 2863 { 2864 let callee = unsafe { 2865 wasmtime::component::TypedFunc::< 2866 (wasmtime::component::__internal::Vec<i32>,), 2867 (), 2868 >::new_unchecked(self.list_s32_param) 2869 }; 2870 let promise = callee 2871 .call_concurrent(store.as_context_mut(), (arg0,)) 2872 .await?; 2873 Ok(promise) 2874 } 2875 pub async fn call_list_s64_param<S: wasmtime::AsContextMut>( 2876 &self, 2877 mut store: S, 2878 arg0: wasmtime::component::__internal::Vec<i64>, 2879 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2880 where 2881 <S as wasmtime::AsContext>::Data: Send + 'static, 2882 { 2883 let callee = unsafe { 2884 wasmtime::component::TypedFunc::< 2885 (wasmtime::component::__internal::Vec<i64>,), 2886 (), 2887 >::new_unchecked(self.list_s64_param) 2888 }; 2889 let promise = callee 2890 .call_concurrent(store.as_context_mut(), (arg0,)) 2891 .await?; 2892 Ok(promise) 2893 } 2894 pub async fn call_list_f32_param<S: wasmtime::AsContextMut>( 2895 &self, 2896 mut store: S, 2897 arg0: wasmtime::component::__internal::Vec<f32>, 2898 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2899 where 2900 <S as wasmtime::AsContext>::Data: Send + 'static, 2901 { 2902 let callee = unsafe { 2903 wasmtime::component::TypedFunc::< 2904 (wasmtime::component::__internal::Vec<f32>,), 2905 (), 2906 >::new_unchecked(self.list_f32_param) 2907 }; 2908 let promise = callee 2909 .call_concurrent(store.as_context_mut(), (arg0,)) 2910 .await?; 2911 Ok(promise) 2912 } 2913 pub async fn call_list_f64_param<S: wasmtime::AsContextMut>( 2914 &self, 2915 mut store: S, 2916 arg0: wasmtime::component::__internal::Vec<f64>, 2917 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 2918 where 2919 <S as wasmtime::AsContext>::Data: Send + 'static, 2920 { 2921 let callee = unsafe { 2922 wasmtime::component::TypedFunc::< 2923 (wasmtime::component::__internal::Vec<f64>,), 2924 (), 2925 >::new_unchecked(self.list_f64_param) 2926 }; 2927 let promise = callee 2928 .call_concurrent(store.as_context_mut(), (arg0,)) 2929 .await?; 2930 Ok(promise) 2931 } 2932 pub async fn call_list_u8_ret<S: wasmtime::AsContextMut>( 2933 &self, 2934 mut store: S, 2935 ) -> wasmtime::Result< 2936 wasmtime::component::Promise< 2937 wasmtime::component::__internal::Vec<u8>, 2938 >, 2939 > 2940 where 2941 <S as wasmtime::AsContext>::Data: Send + 'static, 2942 { 2943 let callee = unsafe { 2944 wasmtime::component::TypedFunc::< 2945 (), 2946 (wasmtime::component::__internal::Vec<u8>,), 2947 >::new_unchecked(self.list_u8_ret) 2948 }; 2949 let promise = callee 2950 .call_concurrent(store.as_context_mut(), ()) 2951 .await?; 2952 Ok(promise.map(|(v,)| v)) 2953 } 2954 pub async fn call_list_u16_ret<S: wasmtime::AsContextMut>( 2955 &self, 2956 mut store: S, 2957 ) -> wasmtime::Result< 2958 wasmtime::component::Promise< 2959 wasmtime::component::__internal::Vec<u16>, 2960 >, 2961 > 2962 where 2963 <S as wasmtime::AsContext>::Data: Send + 'static, 2964 { 2965 let callee = unsafe { 2966 wasmtime::component::TypedFunc::< 2967 (), 2968 (wasmtime::component::__internal::Vec<u16>,), 2969 >::new_unchecked(self.list_u16_ret) 2970 }; 2971 let promise = callee 2972 .call_concurrent(store.as_context_mut(), ()) 2973 .await?; 2974 Ok(promise.map(|(v,)| v)) 2975 } 2976 pub async fn call_list_u32_ret<S: wasmtime::AsContextMut>( 2977 &self, 2978 mut store: S, 2979 ) -> wasmtime::Result< 2980 wasmtime::component::Promise< 2981 wasmtime::component::__internal::Vec<u32>, 2982 >, 2983 > 2984 where 2985 <S as wasmtime::AsContext>::Data: Send + 'static, 2986 { 2987 let callee = unsafe { 2988 wasmtime::component::TypedFunc::< 2989 (), 2990 (wasmtime::component::__internal::Vec<u32>,), 2991 >::new_unchecked(self.list_u32_ret) 2992 }; 2993 let promise = callee 2994 .call_concurrent(store.as_context_mut(), ()) 2995 .await?; 2996 Ok(promise.map(|(v,)| v)) 2997 } 2998 pub async fn call_list_u64_ret<S: wasmtime::AsContextMut>( 2999 &self, 3000 mut store: S, 3001 ) -> wasmtime::Result< 3002 wasmtime::component::Promise< 3003 wasmtime::component::__internal::Vec<u64>, 3004 >, 3005 > 3006 where 3007 <S as wasmtime::AsContext>::Data: Send + 'static, 3008 { 3009 let callee = unsafe { 3010 wasmtime::component::TypedFunc::< 3011 (), 3012 (wasmtime::component::__internal::Vec<u64>,), 3013 >::new_unchecked(self.list_u64_ret) 3014 }; 3015 let promise = callee 3016 .call_concurrent(store.as_context_mut(), ()) 3017 .await?; 3018 Ok(promise.map(|(v,)| v)) 3019 } 3020 pub async fn call_list_s8_ret<S: wasmtime::AsContextMut>( 3021 &self, 3022 mut store: S, 3023 ) -> wasmtime::Result< 3024 wasmtime::component::Promise< 3025 wasmtime::component::__internal::Vec<i8>, 3026 >, 3027 > 3028 where 3029 <S as wasmtime::AsContext>::Data: Send + 'static, 3030 { 3031 let callee = unsafe { 3032 wasmtime::component::TypedFunc::< 3033 (), 3034 (wasmtime::component::__internal::Vec<i8>,), 3035 >::new_unchecked(self.list_s8_ret) 3036 }; 3037 let promise = callee 3038 .call_concurrent(store.as_context_mut(), ()) 3039 .await?; 3040 Ok(promise.map(|(v,)| v)) 3041 } 3042 pub async fn call_list_s16_ret<S: wasmtime::AsContextMut>( 3043 &self, 3044 mut store: S, 3045 ) -> wasmtime::Result< 3046 wasmtime::component::Promise< 3047 wasmtime::component::__internal::Vec<i16>, 3048 >, 3049 > 3050 where 3051 <S as wasmtime::AsContext>::Data: Send + 'static, 3052 { 3053 let callee = unsafe { 3054 wasmtime::component::TypedFunc::< 3055 (), 3056 (wasmtime::component::__internal::Vec<i16>,), 3057 >::new_unchecked(self.list_s16_ret) 3058 }; 3059 let promise = callee 3060 .call_concurrent(store.as_context_mut(), ()) 3061 .await?; 3062 Ok(promise.map(|(v,)| v)) 3063 } 3064 pub async fn call_list_s32_ret<S: wasmtime::AsContextMut>( 3065 &self, 3066 mut store: S, 3067 ) -> wasmtime::Result< 3068 wasmtime::component::Promise< 3069 wasmtime::component::__internal::Vec<i32>, 3070 >, 3071 > 3072 where 3073 <S as wasmtime::AsContext>::Data: Send + 'static, 3074 { 3075 let callee = unsafe { 3076 wasmtime::component::TypedFunc::< 3077 (), 3078 (wasmtime::component::__internal::Vec<i32>,), 3079 >::new_unchecked(self.list_s32_ret) 3080 }; 3081 let promise = callee 3082 .call_concurrent(store.as_context_mut(), ()) 3083 .await?; 3084 Ok(promise.map(|(v,)| v)) 3085 } 3086 pub async fn call_list_s64_ret<S: wasmtime::AsContextMut>( 3087 &self, 3088 mut store: S, 3089 ) -> wasmtime::Result< 3090 wasmtime::component::Promise< 3091 wasmtime::component::__internal::Vec<i64>, 3092 >, 3093 > 3094 where 3095 <S as wasmtime::AsContext>::Data: Send + 'static, 3096 { 3097 let callee = unsafe { 3098 wasmtime::component::TypedFunc::< 3099 (), 3100 (wasmtime::component::__internal::Vec<i64>,), 3101 >::new_unchecked(self.list_s64_ret) 3102 }; 3103 let promise = callee 3104 .call_concurrent(store.as_context_mut(), ()) 3105 .await?; 3106 Ok(promise.map(|(v,)| v)) 3107 } 3108 pub async fn call_list_f32_ret<S: wasmtime::AsContextMut>( 3109 &self, 3110 mut store: S, 3111 ) -> wasmtime::Result< 3112 wasmtime::component::Promise< 3113 wasmtime::component::__internal::Vec<f32>, 3114 >, 3115 > 3116 where 3117 <S as wasmtime::AsContext>::Data: Send + 'static, 3118 { 3119 let callee = unsafe { 3120 wasmtime::component::TypedFunc::< 3121 (), 3122 (wasmtime::component::__internal::Vec<f32>,), 3123 >::new_unchecked(self.list_f32_ret) 3124 }; 3125 let promise = callee 3126 .call_concurrent(store.as_context_mut(), ()) 3127 .await?; 3128 Ok(promise.map(|(v,)| v)) 3129 } 3130 pub async fn call_list_f64_ret<S: wasmtime::AsContextMut>( 3131 &self, 3132 mut store: S, 3133 ) -> wasmtime::Result< 3134 wasmtime::component::Promise< 3135 wasmtime::component::__internal::Vec<f64>, 3136 >, 3137 > 3138 where 3139 <S as wasmtime::AsContext>::Data: Send + 'static, 3140 { 3141 let callee = unsafe { 3142 wasmtime::component::TypedFunc::< 3143 (), 3144 (wasmtime::component::__internal::Vec<f64>,), 3145 >::new_unchecked(self.list_f64_ret) 3146 }; 3147 let promise = callee 3148 .call_concurrent(store.as_context_mut(), ()) 3149 .await?; 3150 Ok(promise.map(|(v,)| v)) 3151 } 3152 pub async fn call_tuple_list<S: wasmtime::AsContextMut>( 3153 &self, 3154 mut store: S, 3155 arg0: wasmtime::component::__internal::Vec<(u8, i8)>, 3156 ) -> wasmtime::Result< 3157 wasmtime::component::Promise< 3158 wasmtime::component::__internal::Vec<(i64, u32)>, 3159 >, 3160 > 3161 where 3162 <S as wasmtime::AsContext>::Data: Send + 'static, 3163 { 3164 let callee = unsafe { 3165 wasmtime::component::TypedFunc::< 3166 (wasmtime::component::__internal::Vec<(u8, i8)>,), 3167 (wasmtime::component::__internal::Vec<(i64, u32)>,), 3168 >::new_unchecked(self.tuple_list) 3169 }; 3170 let promise = callee 3171 .call_concurrent(store.as_context_mut(), (arg0,)) 3172 .await?; 3173 Ok(promise.map(|(v,)| v)) 3174 } 3175 pub async fn call_string_list_arg<S: wasmtime::AsContextMut>( 3176 &self, 3177 mut store: S, 3178 arg0: wasmtime::component::__internal::Vec< 3179 wasmtime::component::__internal::String, 3180 >, 3181 ) -> wasmtime::Result<wasmtime::component::Promise<()>> 3182 where 3183 <S as wasmtime::AsContext>::Data: Send + 'static, 3184 { 3185 let callee = unsafe { 3186 wasmtime::component::TypedFunc::< 3187 ( 3188 wasmtime::component::__internal::Vec< 3189 wasmtime::component::__internal::String, 3190 >, 3191 ), 3192 (), 3193 >::new_unchecked(self.string_list_arg) 3194 }; 3195 let promise = callee 3196 .call_concurrent(store.as_context_mut(), (arg0,)) 3197 .await?; 3198 Ok(promise) 3199 } 3200 pub async fn call_string_list_ret<S: wasmtime::AsContextMut>( 3201 &self, 3202 mut store: S, 3203 ) -> wasmtime::Result< 3204 wasmtime::component::Promise< 3205 wasmtime::component::__internal::Vec< 3206 wasmtime::component::__internal::String, 3207 >, 3208 >, 3209 > 3210 where 3211 <S as wasmtime::AsContext>::Data: Send + 'static, 3212 { 3213 let callee = unsafe { 3214 wasmtime::component::TypedFunc::< 3215 (), 3216 ( 3217 wasmtime::component::__internal::Vec< 3218 wasmtime::component::__internal::String, 3219 >, 3220 ), 3221 >::new_unchecked(self.string_list_ret) 3222 }; 3223 let promise = callee 3224 .call_concurrent(store.as_context_mut(), ()) 3225 .await?; 3226 Ok(promise.map(|(v,)| v)) 3227 } 3228 pub async fn call_tuple_string_list<S: wasmtime::AsContextMut>( 3229 &self, 3230 mut store: S, 3231 arg0: wasmtime::component::__internal::Vec< 3232 (u8, wasmtime::component::__internal::String), 3233 >, 3234 ) -> wasmtime::Result< 3235 wasmtime::component::Promise< 3236 wasmtime::component::__internal::Vec< 3237 (wasmtime::component::__internal::String, u8), 3238 >, 3239 >, 3240 > 3241 where 3242 <S as wasmtime::AsContext>::Data: Send + 'static, 3243 { 3244 let callee = unsafe { 3245 wasmtime::component::TypedFunc::< 3246 ( 3247 wasmtime::component::__internal::Vec< 3248 (u8, wasmtime::component::__internal::String), 3249 >, 3250 ), 3251 ( 3252 wasmtime::component::__internal::Vec< 3253 (wasmtime::component::__internal::String, u8), 3254 >, 3255 ), 3256 >::new_unchecked(self.tuple_string_list) 3257 }; 3258 let promise = callee 3259 .call_concurrent(store.as_context_mut(), (arg0,)) 3260 .await?; 3261 Ok(promise.map(|(v,)| v)) 3262 } 3263 pub async fn call_string_list<S: wasmtime::AsContextMut>( 3264 &self, 3265 mut store: S, 3266 arg0: wasmtime::component::__internal::Vec< 3267 wasmtime::component::__internal::String, 3268 >, 3269 ) -> wasmtime::Result< 3270 wasmtime::component::Promise< 3271 wasmtime::component::__internal::Vec< 3272 wasmtime::component::__internal::String, 3273 >, 3274 >, 3275 > 3276 where 3277 <S as wasmtime::AsContext>::Data: Send + 'static, 3278 { 3279 let callee = unsafe { 3280 wasmtime::component::TypedFunc::< 3281 ( 3282 wasmtime::component::__internal::Vec< 3283 wasmtime::component::__internal::String, 3284 >, 3285 ), 3286 ( 3287 wasmtime::component::__internal::Vec< 3288 wasmtime::component::__internal::String, 3289 >, 3290 ), 3291 >::new_unchecked(self.string_list) 3292 }; 3293 let promise = callee 3294 .call_concurrent(store.as_context_mut(), (arg0,)) 3295 .await?; 3296 Ok(promise.map(|(v,)| v)) 3297 } 3298 pub async fn call_record_list<S: wasmtime::AsContextMut>( 3299 &self, 3300 mut store: S, 3301 arg0: wasmtime::component::__internal::Vec<SomeRecord>, 3302 ) -> wasmtime::Result< 3303 wasmtime::component::Promise< 3304 wasmtime::component::__internal::Vec<OtherRecord>, 3305 >, 3306 > 3307 where 3308 <S as wasmtime::AsContext>::Data: Send + 'static, 3309 { 3310 let callee = unsafe { 3311 wasmtime::component::TypedFunc::< 3312 (wasmtime::component::__internal::Vec<SomeRecord>,), 3313 (wasmtime::component::__internal::Vec<OtherRecord>,), 3314 >::new_unchecked(self.record_list) 3315 }; 3316 let promise = callee 3317 .call_concurrent(store.as_context_mut(), (arg0,)) 3318 .await?; 3319 Ok(promise.map(|(v,)| v)) 3320 } 3321 pub async fn call_record_list_reverse<S: wasmtime::AsContextMut>( 3322 &self, 3323 mut store: S, 3324 arg0: wasmtime::component::__internal::Vec<OtherRecord>, 3325 ) -> wasmtime::Result< 3326 wasmtime::component::Promise< 3327 wasmtime::component::__internal::Vec<SomeRecord>, 3328 >, 3329 > 3330 where 3331 <S as wasmtime::AsContext>::Data: Send + 'static, 3332 { 3333 let callee = unsafe { 3334 wasmtime::component::TypedFunc::< 3335 (wasmtime::component::__internal::Vec<OtherRecord>,), 3336 (wasmtime::component::__internal::Vec<SomeRecord>,), 3337 >::new_unchecked(self.record_list_reverse) 3338 }; 3339 let promise = callee 3340 .call_concurrent(store.as_context_mut(), (arg0,)) 3341 .await?; 3342 Ok(promise.map(|(v,)| v)) 3343 } 3344 pub async fn call_variant_list<S: wasmtime::AsContextMut>( 3345 &self, 3346 mut store: S, 3347 arg0: wasmtime::component::__internal::Vec<SomeVariant>, 3348 ) -> wasmtime::Result< 3349 wasmtime::component::Promise< 3350 wasmtime::component::__internal::Vec<OtherVariant>, 3351 >, 3352 > 3353 where 3354 <S as wasmtime::AsContext>::Data: Send + 'static, 3355 { 3356 let callee = unsafe { 3357 wasmtime::component::TypedFunc::< 3358 (wasmtime::component::__internal::Vec<SomeVariant>,), 3359 (wasmtime::component::__internal::Vec<OtherVariant>,), 3360 >::new_unchecked(self.variant_list) 3361 }; 3362 let promise = callee 3363 .call_concurrent(store.as_context_mut(), (arg0,)) 3364 .await?; 3365 Ok(promise.map(|(v,)| v)) 3366 } 3367 pub async fn call_load_store_everything<S: wasmtime::AsContextMut>( 3368 &self, 3369 mut store: S, 3370 arg0: LoadStoreAllSizes, 3371 ) -> wasmtime::Result< 3372 wasmtime::component::Promise<LoadStoreAllSizes>, 3373 > 3374 where 3375 <S as wasmtime::AsContext>::Data: Send + 'static, 3376 { 3377 let callee = unsafe { 3378 wasmtime::component::TypedFunc::< 3379 (LoadStoreAllSizes,), 3380 (LoadStoreAllSizes,), 3381 >::new_unchecked(self.load_store_everything) 3382 }; 3383 let promise = callee 3384 .call_concurrent(store.as_context_mut(), (arg0,)) 3385 .await?; 3386 Ok(promise.map(|(v,)| v)) 3387 } 3388 } 3389 } 3390 } 3391 } 3392 } 3393