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