1 /// Auto-generated bindings for a pre-instantiated version of a 2 /// component which implements the world `my-world`. 3 /// 4 /// This structure is created through [`MyWorldPre::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 [`MyWorld`] as well. 9 pub struct MyWorldPre<T: 'static> { 10 instance_pre: wasmtime::component::InstancePre<T>, 11 indices: MyWorldIndices, 12 } 13 impl<T: 'static> Clone for MyWorldPre<T> { clone(&self) -> Self14 fn clone(&self) -> Self { 15 Self { 16 instance_pre: self.instance_pre.clone(), 17 indices: self.indices.clone(), 18 } 19 } 20 } 21 impl<_T: 'static> MyWorldPre<_T> { 22 /// Creates a new copy of `MyWorldPre` 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. new( instance_pre: wasmtime::component::InstancePre<_T>, ) -> wasmtime::Result<Self>27 pub fn new( 28 instance_pre: wasmtime::component::InstancePre<_T>, 29 ) -> wasmtime::Result<Self> { 30 let indices = MyWorldIndices::new(&instance_pre)?; 31 Ok(Self { instance_pre, indices }) 32 } engine(&self) -> &wasmtime::Engine33 pub fn engine(&self) -> &wasmtime::Engine { 34 self.instance_pre.engine() 35 } instance_pre(&self) -> &wasmtime::component::InstancePre<_T>36 pub fn instance_pre(&self) -> &wasmtime::component::InstancePre<_T> { 37 &self.instance_pre 38 } 39 /// Instantiates a new instance of [`MyWorld`] 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. instantiate( &self, mut store: impl wasmtime::AsContextMut<Data = _T>, ) -> wasmtime::Result<MyWorld>46 pub fn instantiate( 47 &self, 48 mut store: impl wasmtime::AsContextMut<Data = _T>, 49 ) -> wasmtime::Result<MyWorld> { 50 let mut store = store.as_context_mut(); 51 let instance = self.instance_pre.instantiate(&mut store)?; 52 self.indices.load(&mut store, &instance) 53 } 54 } 55 impl<_T: Send + 'static> MyWorldPre<_T> { 56 /// Same as [`Self::instantiate`], except with `async`. instantiate_async( &self, mut store: impl wasmtime::AsContextMut<Data = _T>, ) -> wasmtime::Result<MyWorld>57 pub async fn instantiate_async( 58 &self, 59 mut store: impl wasmtime::AsContextMut<Data = _T>, 60 ) -> wasmtime::Result<MyWorld> { 61 let mut store = store.as_context_mut(); 62 let instance = self.instance_pre.instantiate_async(&mut store).await?; 63 self.indices.load(&mut store, &instance) 64 } 65 } 66 /// Auto-generated bindings for index of the exports of 67 /// `my-world`. 68 /// 69 /// This is an implementation detail of [`MyWorldPre`] and can 70 /// be constructed if needed as well. 71 /// 72 /// For more information see [`MyWorld`] as well. 73 #[derive(Clone)] 74 pub struct MyWorldIndices { 75 interface0: exports::foo::foo::simple_lists::GuestIndices, 76 } 77 /// Auto-generated bindings for an instance a component which 78 /// implements the world `my-world`. 79 /// 80 /// This structure can be created through a number of means 81 /// depending on your requirements and what you have on hand: 82 /// 83 /// * The most convenient way is to use 84 /// [`MyWorld::instantiate`] which only needs a 85 /// [`Store`], [`Component`], and [`Linker`]. 86 /// 87 /// * Alternatively you can create a [`MyWorldPre`] ahead of 88 /// time with a [`Component`] to front-load string lookups 89 /// of exports once instead of per-instantiation. This 90 /// method then uses [`MyWorldPre::instantiate`] to 91 /// create a [`MyWorld`]. 92 /// 93 /// * If you've instantiated the instance yourself already 94 /// then you can use [`MyWorld::new`]. 95 /// 96 /// These methods are all equivalent to one another and move 97 /// around the tradeoff of what work is performed when. 98 /// 99 /// [`Store`]: wasmtime::Store 100 /// [`Component`]: wasmtime::component::Component 101 /// [`Linker`]: wasmtime::component::Linker 102 pub struct MyWorld { 103 interface0: exports::foo::foo::simple_lists::Guest, 104 } 105 const _: () = { 106 impl MyWorldIndices { 107 /// Creates a new copy of `MyWorldIndices` bindings which can then 108 /// be used to instantiate into a particular store. 109 /// 110 /// This method may fail if the component does not have the 111 /// required exports. new<_T>( _instance_pre: &wasmtime::component::InstancePre<_T>, ) -> wasmtime::Result<Self>112 pub fn new<_T>( 113 _instance_pre: &wasmtime::component::InstancePre<_T>, 114 ) -> wasmtime::Result<Self> { 115 let _component = _instance_pre.component(); 116 let _instance_type = _instance_pre.instance_type(); 117 let interface0 = exports::foo::foo::simple_lists::GuestIndices::new( 118 _instance_pre, 119 )?; 120 Ok(MyWorldIndices { interface0 }) 121 } 122 /// Uses the indices stored in `self` to load an instance 123 /// of [`MyWorld`] from the instance provided. 124 /// 125 /// Note that at this time this method will additionally 126 /// perform type-checks of all exports. load( &self, mut store: impl wasmtime::AsContextMut, instance: &wasmtime::component::Instance, ) -> wasmtime::Result<MyWorld>127 pub fn load( 128 &self, 129 mut store: impl wasmtime::AsContextMut, 130 instance: &wasmtime::component::Instance, 131 ) -> wasmtime::Result<MyWorld> { 132 let _ = &mut store; 133 let _instance = instance; 134 let interface0 = self.interface0.load(&mut store, &_instance)?; 135 Ok(MyWorld { interface0 }) 136 } 137 } 138 impl MyWorld { 139 /// Convenience wrapper around [`MyWorldPre::new`] and 140 /// [`MyWorldPre::instantiate`]. instantiate<_T>( store: impl wasmtime::AsContextMut<Data = _T>, component: &wasmtime::component::Component, linker: &wasmtime::component::Linker<_T>, ) -> wasmtime::Result<MyWorld>141 pub fn instantiate<_T>( 142 store: impl wasmtime::AsContextMut<Data = _T>, 143 component: &wasmtime::component::Component, 144 linker: &wasmtime::component::Linker<_T>, 145 ) -> wasmtime::Result<MyWorld> { 146 let pre = linker.instantiate_pre(component)?; 147 MyWorldPre::new(pre)?.instantiate(store) 148 } 149 /// Convenience wrapper around [`MyWorldIndices::new`] and 150 /// [`MyWorldIndices::load`]. new( mut store: impl wasmtime::AsContextMut, instance: &wasmtime::component::Instance, ) -> wasmtime::Result<MyWorld>151 pub fn new( 152 mut store: impl wasmtime::AsContextMut, 153 instance: &wasmtime::component::Instance, 154 ) -> wasmtime::Result<MyWorld> { 155 let indices = MyWorldIndices::new(&instance.instance_pre(&store))?; 156 indices.load(&mut store, instance) 157 } 158 /// Convenience wrapper around [`MyWorldPre::new`] and 159 /// [`MyWorldPre::instantiate_async`]. instantiate_async<_T>( store: impl wasmtime::AsContextMut<Data = _T>, component: &wasmtime::component::Component, linker: &wasmtime::component::Linker<_T>, ) -> wasmtime::Result<MyWorld> where _T: Send,160 pub async fn instantiate_async<_T>( 161 store: impl wasmtime::AsContextMut<Data = _T>, 162 component: &wasmtime::component::Component, 163 linker: &wasmtime::component::Linker<_T>, 164 ) -> wasmtime::Result<MyWorld> 165 where 166 _T: Send, 167 { 168 let pre = linker.instantiate_pre(component)?; 169 MyWorldPre::new(pre)?.instantiate_async(store).await 170 } add_to_linker<T, D>( linker: &mut wasmtime::component::Linker<T>, host_getter: fn(&mut T) -> D::Data<'_>, ) -> wasmtime::Result<()> where D: foo::foo::simple_lists::HostWithStore + Send, for<'a> D::Data<'a>: foo::foo::simple_lists::Host + Send, T: 'static + Send,171 pub fn add_to_linker<T, D>( 172 linker: &mut wasmtime::component::Linker<T>, 173 host_getter: fn(&mut T) -> D::Data<'_>, 174 ) -> wasmtime::Result<()> 175 where 176 D: foo::foo::simple_lists::HostWithStore + Send, 177 for<'a> D::Data<'a>: foo::foo::simple_lists::Host + Send, 178 T: 'static + Send, 179 { 180 foo::foo::simple_lists::add_to_linker::<T, D>(linker, host_getter)?; 181 Ok(()) 182 } foo_foo_simple_lists(&self) -> &exports::foo::foo::simple_lists::Guest183 pub fn foo_foo_simple_lists(&self) -> &exports::foo::foo::simple_lists::Guest { 184 &self.interface0 185 } 186 } 187 }; 188 pub mod foo { 189 pub mod foo { 190 #[allow(clippy::all)] 191 pub mod simple_lists { 192 #[allow(unused_imports)] 193 use wasmtime::component::__internal::Box; 194 pub trait HostWithStore: wasmtime::component::HasData + Send {} 195 impl<_T: ?Sized> HostWithStore for _T 196 where 197 _T: wasmtime::component::HasData + Send, 198 {} 199 pub trait Host: Send { simple_list1( &mut self, l: wasmtime::component::__internal::Vec<u32>, ) -> impl ::core::future::Future<Output = ()> + Send200 fn simple_list1( 201 &mut self, 202 l: wasmtime::component::__internal::Vec<u32>, 203 ) -> impl ::core::future::Future<Output = ()> + Send; simple_list2( &mut self, ) -> impl ::core::future::Future< Output = wasmtime::component::__internal::Vec<u32>, > + Send204 fn simple_list2( 205 &mut self, 206 ) -> impl ::core::future::Future< 207 Output = wasmtime::component::__internal::Vec<u32>, 208 > + Send; simple_list3( &mut self, a: wasmtime::component::__internal::Vec<u32>, b: wasmtime::component::__internal::Vec<u32>, ) -> impl ::core::future::Future< Output = ( wasmtime::component::__internal::Vec<u32>, wasmtime::component::__internal::Vec<u32>, ), > + Send209 fn simple_list3( 210 &mut self, 211 a: wasmtime::component::__internal::Vec<u32>, 212 b: wasmtime::component::__internal::Vec<u32>, 213 ) -> impl ::core::future::Future< 214 Output = ( 215 wasmtime::component::__internal::Vec<u32>, 216 wasmtime::component::__internal::Vec<u32>, 217 ), 218 > + Send; simple_list4( &mut self, l: wasmtime::component::__internal::Vec< wasmtime::component::__internal::Vec<u32>, >, ) -> impl ::core::future::Future< Output = wasmtime::component::__internal::Vec< wasmtime::component::__internal::Vec<u32>, >, > + Send219 fn simple_list4( 220 &mut self, 221 l: wasmtime::component::__internal::Vec< 222 wasmtime::component::__internal::Vec<u32>, 223 >, 224 ) -> impl ::core::future::Future< 225 Output = wasmtime::component::__internal::Vec< 226 wasmtime::component::__internal::Vec<u32>, 227 >, 228 > + Send; 229 } 230 impl<_T: Host + ?Sized + Send> Host for &mut _T { simple_list1( &mut self, l: wasmtime::component::__internal::Vec<u32>, ) -> impl ::core::future::Future<Output = ()> + Send231 fn simple_list1( 232 &mut self, 233 l: wasmtime::component::__internal::Vec<u32>, 234 ) -> impl ::core::future::Future<Output = ()> + Send { 235 async move { Host::simple_list1(*self, l).await } 236 } simple_list2( &mut self, ) -> impl ::core::future::Future< Output = wasmtime::component::__internal::Vec<u32>, > + Send237 fn simple_list2( 238 &mut self, 239 ) -> impl ::core::future::Future< 240 Output = wasmtime::component::__internal::Vec<u32>, 241 > + Send { 242 async move { Host::simple_list2(*self).await } 243 } simple_list3( &mut self, a: wasmtime::component::__internal::Vec<u32>, b: wasmtime::component::__internal::Vec<u32>, ) -> impl ::core::future::Future< Output = ( wasmtime::component::__internal::Vec<u32>, wasmtime::component::__internal::Vec<u32>, ), > + Send244 fn simple_list3( 245 &mut self, 246 a: wasmtime::component::__internal::Vec<u32>, 247 b: wasmtime::component::__internal::Vec<u32>, 248 ) -> impl ::core::future::Future< 249 Output = ( 250 wasmtime::component::__internal::Vec<u32>, 251 wasmtime::component::__internal::Vec<u32>, 252 ), 253 > + Send { 254 async move { Host::simple_list3(*self, a, b).await } 255 } simple_list4( &mut self, l: wasmtime::component::__internal::Vec< wasmtime::component::__internal::Vec<u32>, >, ) -> impl ::core::future::Future< Output = wasmtime::component::__internal::Vec< wasmtime::component::__internal::Vec<u32>, >, > + Send256 fn simple_list4( 257 &mut self, 258 l: wasmtime::component::__internal::Vec< 259 wasmtime::component::__internal::Vec<u32>, 260 >, 261 ) -> impl ::core::future::Future< 262 Output = wasmtime::component::__internal::Vec< 263 wasmtime::component::__internal::Vec<u32>, 264 >, 265 > + Send { 266 async move { Host::simple_list4(*self, l).await } 267 } 268 } add_to_linker<T, D>( linker: &mut wasmtime::component::Linker<T>, host_getter: fn(&mut T) -> D::Data<'_>, ) -> wasmtime::Result<()> where D: HostWithStore, for<'a> D::Data<'a>: Host, T: 'static + Send,269 pub fn add_to_linker<T, D>( 270 linker: &mut wasmtime::component::Linker<T>, 271 host_getter: fn(&mut T) -> D::Data<'_>, 272 ) -> wasmtime::Result<()> 273 where 274 D: HostWithStore, 275 for<'a> D::Data<'a>: Host, 276 T: 'static + Send, 277 { 278 let mut inst = linker.instance("foo:foo/simple-lists")?; 279 inst.func_wrap_async( 280 "simple-list1", 281 move | 282 mut caller: wasmtime::StoreContextMut<'_, T>, 283 (arg0,): (wasmtime::component::__internal::Vec<u32>,)| 284 { 285 use tracing::Instrument; 286 let span = tracing::span!( 287 tracing::Level::TRACE, "wit-bindgen import", module = 288 "simple-lists", function = "simple-list1", 289 ); 290 wasmtime::component::__internal::Box::new( 291 async move { 292 tracing::event!( 293 tracing::Level::TRACE, l = tracing::field::debug("..."), 294 "call" 295 ); 296 let host = &mut host_getter(caller.data_mut()); 297 let r = Host::simple_list1(host, arg0).await; 298 tracing::event!( 299 tracing::Level::TRACE, result = tracing::field::debug(& r), 300 "return" 301 ); 302 Ok(r) 303 } 304 .instrument(span), 305 ) 306 }, 307 )?; 308 inst.func_wrap_async( 309 "simple-list2", 310 move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| { 311 use tracing::Instrument; 312 let span = tracing::span!( 313 tracing::Level::TRACE, "wit-bindgen import", module = 314 "simple-lists", function = "simple-list2", 315 ); 316 wasmtime::component::__internal::Box::new( 317 async move { 318 tracing::event!(tracing::Level::TRACE, "call"); 319 let host = &mut host_getter(caller.data_mut()); 320 let r = Host::simple_list2(host).await; 321 tracing::event!( 322 tracing::Level::TRACE, result = 323 tracing::field::debug("..."), "return" 324 ); 325 Ok((r,)) 326 } 327 .instrument(span), 328 ) 329 }, 330 )?; 331 inst.func_wrap_async( 332 "simple-list3", 333 move | 334 mut caller: wasmtime::StoreContextMut<'_, T>, 335 ( 336 arg0, 337 arg1, 338 ): ( 339 wasmtime::component::__internal::Vec<u32>, 340 wasmtime::component::__internal::Vec<u32>, 341 )| 342 { 343 use tracing::Instrument; 344 let span = tracing::span!( 345 tracing::Level::TRACE, "wit-bindgen import", module = 346 "simple-lists", function = "simple-list3", 347 ); 348 wasmtime::component::__internal::Box::new( 349 async move { 350 tracing::event!( 351 tracing::Level::TRACE, a = tracing::field::debug("..."), b = 352 tracing::field::debug("..."), "call" 353 ); 354 let host = &mut host_getter(caller.data_mut()); 355 let r = Host::simple_list3(host, arg0, arg1).await; 356 tracing::event!( 357 tracing::Level::TRACE, result = 358 tracing::field::debug("..."), "return" 359 ); 360 Ok((r,)) 361 } 362 .instrument(span), 363 ) 364 }, 365 )?; 366 inst.func_wrap_async( 367 "simple-list4", 368 move | 369 mut caller: wasmtime::StoreContextMut<'_, T>, 370 ( 371 arg0, 372 ): ( 373 wasmtime::component::__internal::Vec< 374 wasmtime::component::__internal::Vec<u32>, 375 >, 376 )| 377 { 378 use tracing::Instrument; 379 let span = tracing::span!( 380 tracing::Level::TRACE, "wit-bindgen import", module = 381 "simple-lists", function = "simple-list4", 382 ); 383 wasmtime::component::__internal::Box::new( 384 async move { 385 tracing::event!( 386 tracing::Level::TRACE, l = tracing::field::debug("..."), 387 "call" 388 ); 389 let host = &mut host_getter(caller.data_mut()); 390 let r = Host::simple_list4(host, arg0).await; 391 tracing::event!( 392 tracing::Level::TRACE, result = 393 tracing::field::debug("..."), "return" 394 ); 395 Ok((r,)) 396 } 397 .instrument(span), 398 ) 399 }, 400 )?; 401 Ok(()) 402 } 403 } 404 } 405 } 406 pub mod exports { 407 pub mod foo { 408 pub mod foo { 409 #[allow(clippy::all)] 410 pub mod simple_lists { 411 #[allow(unused_imports)] 412 use wasmtime::component::__internal::Box; 413 #[derive(Clone)] 414 pub struct Guest { 415 simple_list1: wasmtime::component::Func, 416 simple_list2: wasmtime::component::Func, 417 simple_list3: wasmtime::component::Func, 418 simple_list4: wasmtime::component::Func, 419 } 420 #[derive(Clone)] 421 pub struct GuestIndices { 422 simple_list1: wasmtime::component::ComponentExportIndex, 423 simple_list2: wasmtime::component::ComponentExportIndex, 424 simple_list3: wasmtime::component::ComponentExportIndex, 425 simple_list4: wasmtime::component::ComponentExportIndex, 426 } 427 impl GuestIndices { 428 /// Constructor for [`GuestIndices`] which takes a 429 /// [`Component`](wasmtime::component::Component) as input and can be executed 430 /// before instantiation. 431 /// 432 /// This constructor can be used to front-load string lookups to find exports 433 /// within a component. new<_T>( _instance_pre: &wasmtime::component::InstancePre<_T>, ) -> wasmtime::Result<GuestIndices>434 pub fn new<_T>( 435 _instance_pre: &wasmtime::component::InstancePre<_T>, 436 ) -> wasmtime::Result<GuestIndices> { 437 let instance = _instance_pre 438 .component() 439 .get_export_index(None, "foo:foo/simple-lists") 440 .ok_or_else(|| { 441 wasmtime::format_err!( 442 "no exported instance named `foo:foo/simple-lists`" 443 ) 444 })?; 445 let mut lookup = move |name| { 446 _instance_pre 447 .component() 448 .get_export_index(Some(&instance), name) 449 .ok_or_else(|| { 450 wasmtime::format_err!( 451 "instance export `foo:foo/simple-lists` does \ 452 not have export `{name}`" 453 ) 454 }) 455 }; 456 let _ = &mut lookup; 457 let simple_list1 = lookup("simple-list1")?; 458 let simple_list2 = lookup("simple-list2")?; 459 let simple_list3 = lookup("simple-list3")?; 460 let simple_list4 = lookup("simple-list4")?; 461 Ok(GuestIndices { 462 simple_list1, 463 simple_list2, 464 simple_list3, 465 simple_list4, 466 }) 467 } load( &self, mut store: impl wasmtime::AsContextMut, instance: &wasmtime::component::Instance, ) -> wasmtime::Result<Guest>468 pub fn load( 469 &self, 470 mut store: impl wasmtime::AsContextMut, 471 instance: &wasmtime::component::Instance, 472 ) -> wasmtime::Result<Guest> { 473 let _instance = instance; 474 let _instance_pre = _instance.instance_pre(&store); 475 let _instance_type = _instance_pre.instance_type(); 476 let mut store = store.as_context_mut(); 477 let _ = &mut store; 478 let simple_list1 = *_instance 479 .get_typed_func::< 480 (&[u32],), 481 (), 482 >(&mut store, &self.simple_list1)? 483 .func(); 484 let simple_list2 = *_instance 485 .get_typed_func::< 486 (), 487 (wasmtime::component::__internal::Vec<u32>,), 488 >(&mut store, &self.simple_list2)? 489 .func(); 490 let simple_list3 = *_instance 491 .get_typed_func::< 492 (&[u32], &[u32]), 493 ( 494 ( 495 wasmtime::component::__internal::Vec<u32>, 496 wasmtime::component::__internal::Vec<u32>, 497 ), 498 ), 499 >(&mut store, &self.simple_list3)? 500 .func(); 501 let simple_list4 = *_instance 502 .get_typed_func::< 503 (&[wasmtime::component::__internal::Vec<u32>],), 504 ( 505 wasmtime::component::__internal::Vec< 506 wasmtime::component::__internal::Vec<u32>, 507 >, 508 ), 509 >(&mut store, &self.simple_list4)? 510 .func(); 511 Ok(Guest { 512 simple_list1, 513 simple_list2, 514 simple_list3, 515 simple_list4, 516 }) 517 } 518 } 519 impl Guest { call_simple_list1<S: wasmtime::AsContextMut>( &self, mut store: S, arg0: &[u32], ) -> wasmtime::Result<()> where <S as wasmtime::AsContext>::Data: Send,520 pub async fn call_simple_list1<S: wasmtime::AsContextMut>( 521 &self, 522 mut store: S, 523 arg0: &[u32], 524 ) -> wasmtime::Result<()> 525 where 526 <S as wasmtime::AsContext>::Data: Send, 527 { 528 use tracing::Instrument; 529 let span = tracing::span!( 530 tracing::Level::TRACE, "wit-bindgen export", module = 531 "foo:foo/simple-lists", function = "simple-list1", 532 ); 533 let callee = unsafe { 534 wasmtime::component::TypedFunc::< 535 (&[u32],), 536 (), 537 >::new_unchecked(self.simple_list1) 538 }; 539 let () = callee 540 .call_async(store.as_context_mut(), (arg0,)) 541 .instrument(span.clone()) 542 .await?; 543 Ok(()) 544 } call_simple_list2<S: wasmtime::AsContextMut>( &self, mut store: S, ) -> wasmtime::Result<wasmtime::component::__internal::Vec<u32>> where <S as wasmtime::AsContext>::Data: Send,545 pub async fn call_simple_list2<S: wasmtime::AsContextMut>( 546 &self, 547 mut store: S, 548 ) -> wasmtime::Result<wasmtime::component::__internal::Vec<u32>> 549 where 550 <S as wasmtime::AsContext>::Data: Send, 551 { 552 use tracing::Instrument; 553 let span = tracing::span!( 554 tracing::Level::TRACE, "wit-bindgen export", module = 555 "foo:foo/simple-lists", function = "simple-list2", 556 ); 557 let callee = unsafe { 558 wasmtime::component::TypedFunc::< 559 (), 560 (wasmtime::component::__internal::Vec<u32>,), 561 >::new_unchecked(self.simple_list2) 562 }; 563 let (ret0,) = callee 564 .call_async(store.as_context_mut(), ()) 565 .instrument(span.clone()) 566 .await?; 567 Ok(ret0) 568 } call_simple_list3<S: wasmtime::AsContextMut>( &self, mut store: S, arg0: &[u32], arg1: &[u32], ) -> wasmtime::Result< ( wasmtime::component::__internal::Vec<u32>, wasmtime::component::__internal::Vec<u32>, ), > where <S as wasmtime::AsContext>::Data: Send,569 pub async fn call_simple_list3<S: wasmtime::AsContextMut>( 570 &self, 571 mut store: S, 572 arg0: &[u32], 573 arg1: &[u32], 574 ) -> wasmtime::Result< 575 ( 576 wasmtime::component::__internal::Vec<u32>, 577 wasmtime::component::__internal::Vec<u32>, 578 ), 579 > 580 where 581 <S as wasmtime::AsContext>::Data: Send, 582 { 583 use tracing::Instrument; 584 let span = tracing::span!( 585 tracing::Level::TRACE, "wit-bindgen export", module = 586 "foo:foo/simple-lists", function = "simple-list3", 587 ); 588 let callee = unsafe { 589 wasmtime::component::TypedFunc::< 590 (&[u32], &[u32]), 591 ( 592 ( 593 wasmtime::component::__internal::Vec<u32>, 594 wasmtime::component::__internal::Vec<u32>, 595 ), 596 ), 597 >::new_unchecked(self.simple_list3) 598 }; 599 let (ret0,) = callee 600 .call_async(store.as_context_mut(), (arg0, arg1)) 601 .instrument(span.clone()) 602 .await?; 603 Ok(ret0) 604 } call_simple_list4<S: wasmtime::AsContextMut>( &self, mut store: S, arg0: &[wasmtime::component::__internal::Vec<u32>], ) -> wasmtime::Result< wasmtime::component::__internal::Vec< wasmtime::component::__internal::Vec<u32>, >, > where <S as wasmtime::AsContext>::Data: Send,605 pub async fn call_simple_list4<S: wasmtime::AsContextMut>( 606 &self, 607 mut store: S, 608 arg0: &[wasmtime::component::__internal::Vec<u32>], 609 ) -> wasmtime::Result< 610 wasmtime::component::__internal::Vec< 611 wasmtime::component::__internal::Vec<u32>, 612 >, 613 > 614 where 615 <S as wasmtime::AsContext>::Data: Send, 616 { 617 use tracing::Instrument; 618 let span = tracing::span!( 619 tracing::Level::TRACE, "wit-bindgen export", module = 620 "foo:foo/simple-lists", function = "simple-list4", 621 ); 622 let callee = unsafe { 623 wasmtime::component::TypedFunc::< 624 (&[wasmtime::component::__internal::Vec<u32>],), 625 ( 626 wasmtime::component::__internal::Vec< 627 wasmtime::component::__internal::Vec<u32>, 628 >, 629 ), 630 >::new_unchecked(self.simple_list4) 631 }; 632 let (ret0,) = callee 633 .call_async(store.as_context_mut(), (arg0,)) 634 .instrument(span.clone()) 635 .await?; 636 Ok(ret0) 637 } 638 } 639 } 640 } 641 } 642 } 643