Path: blob/main/crates/component-macro/tests/expanded/lists_async.rs
3068 views
/// Auto-generated bindings for a pre-instantiated version of a1/// component which implements the world `the-lists`.2///3/// This structure is created through [`TheListsPre::new`] which4/// takes a [`InstancePre`](wasmtime::component::InstancePre) that5/// has been created through a [`Linker`](wasmtime::component::Linker).6///7/// For more information see [`TheLists`] as well.8pub struct TheListsPre<T: 'static> {9instance_pre: wasmtime::component::InstancePre<T>,10indices: TheListsIndices,11}12impl<T: 'static> Clone for TheListsPre<T> {13fn clone(&self) -> Self {14Self {15instance_pre: self.instance_pre.clone(),16indices: self.indices.clone(),17}18}19}20impl<_T: 'static> TheListsPre<_T> {21/// Creates a new copy of `TheListsPre` bindings which can then22/// be used to instantiate into a particular store.23///24/// This method may fail if the component behind `instance_pre`25/// does not have the required exports.26pub fn new(27instance_pre: wasmtime::component::InstancePre<_T>,28) -> wasmtime::Result<Self> {29let indices = TheListsIndices::new(&instance_pre)?;30Ok(Self { instance_pre, indices })31}32pub fn engine(&self) -> &wasmtime::Engine {33self.instance_pre.engine()34}35pub fn instance_pre(&self) -> &wasmtime::component::InstancePre<_T> {36&self.instance_pre37}38/// Instantiates a new instance of [`TheLists`] within the39/// `store` provided.40///41/// This function will use `self` as the pre-instantiated42/// instance to perform instantiation. Afterwards the preloaded43/// indices in `self` are used to lookup all exports on the44/// resulting instance.45pub fn instantiate(46&self,47mut store: impl wasmtime::AsContextMut<Data = _T>,48) -> wasmtime::Result<TheLists> {49let mut store = store.as_context_mut();50let instance = self.instance_pre.instantiate(&mut store)?;51self.indices.load(&mut store, &instance)52}53}54impl<_T: Send + 'static> TheListsPre<_T> {55/// Same as [`Self::instantiate`], except with `async`.56pub async fn instantiate_async(57&self,58mut store: impl wasmtime::AsContextMut<Data = _T>,59) -> wasmtime::Result<TheLists> {60let mut store = store.as_context_mut();61let instance = self.instance_pre.instantiate_async(&mut store).await?;62self.indices.load(&mut store, &instance)63}64}65/// Auto-generated bindings for index of the exports of66/// `the-lists`.67///68/// This is an implementation detail of [`TheListsPre`] and can69/// be constructed if needed as well.70///71/// For more information see [`TheLists`] as well.72#[derive(Clone)]73pub struct TheListsIndices {74interface0: exports::foo::foo::lists::GuestIndices,75}76/// Auto-generated bindings for an instance a component which77/// implements the world `the-lists`.78///79/// This structure can be created through a number of means80/// depending on your requirements and what you have on hand:81///82/// * The most convenient way is to use83/// [`TheLists::instantiate`] which only needs a84/// [`Store`], [`Component`], and [`Linker`].85///86/// * Alternatively you can create a [`TheListsPre`] ahead of87/// time with a [`Component`] to front-load string lookups88/// of exports once instead of per-instantiation. This89/// method then uses [`TheListsPre::instantiate`] to90/// create a [`TheLists`].91///92/// * If you've instantiated the instance yourself already93/// then you can use [`TheLists::new`].94///95/// These methods are all equivalent to one another and move96/// around the tradeoff of what work is performed when.97///98/// [`Store`]: wasmtime::Store99/// [`Component`]: wasmtime::component::Component100/// [`Linker`]: wasmtime::component::Linker101pub struct TheLists {102interface0: exports::foo::foo::lists::Guest,103}104const _: () = {105impl TheListsIndices {106/// Creates a new copy of `TheListsIndices` bindings which can then107/// be used to instantiate into a particular store.108///109/// This method may fail if the component does not have the110/// required exports.111pub fn new<_T>(112_instance_pre: &wasmtime::component::InstancePre<_T>,113) -> wasmtime::Result<Self> {114let _component = _instance_pre.component();115let _instance_type = _instance_pre.instance_type();116let interface0 = exports::foo::foo::lists::GuestIndices::new(_instance_pre)?;117Ok(TheListsIndices { interface0 })118}119/// Uses the indices stored in `self` to load an instance120/// of [`TheLists`] from the instance provided.121///122/// Note that at this time this method will additionally123/// perform type-checks of all exports.124pub fn load(125&self,126mut store: impl wasmtime::AsContextMut,127instance: &wasmtime::component::Instance,128) -> wasmtime::Result<TheLists> {129let _ = &mut store;130let _instance = instance;131let interface0 = self.interface0.load(&mut store, &_instance)?;132Ok(TheLists { interface0 })133}134}135impl TheLists {136/// Convenience wrapper around [`TheListsPre::new`] and137/// [`TheListsPre::instantiate`].138pub fn instantiate<_T>(139store: impl wasmtime::AsContextMut<Data = _T>,140component: &wasmtime::component::Component,141linker: &wasmtime::component::Linker<_T>,142) -> wasmtime::Result<TheLists> {143let pre = linker.instantiate_pre(component)?;144TheListsPre::new(pre)?.instantiate(store)145}146/// Convenience wrapper around [`TheListsIndices::new`] and147/// [`TheListsIndices::load`].148pub fn new(149mut store: impl wasmtime::AsContextMut,150instance: &wasmtime::component::Instance,151) -> wasmtime::Result<TheLists> {152let indices = TheListsIndices::new(&instance.instance_pre(&store))?;153indices.load(&mut store, instance)154}155/// Convenience wrapper around [`TheListsPre::new`] and156/// [`TheListsPre::instantiate_async`].157pub async fn instantiate_async<_T>(158store: impl wasmtime::AsContextMut<Data = _T>,159component: &wasmtime::component::Component,160linker: &wasmtime::component::Linker<_T>,161) -> wasmtime::Result<TheLists>162where163_T: Send,164{165let pre = linker.instantiate_pre(component)?;166TheListsPre::new(pre)?.instantiate_async(store).await167}168pub fn add_to_linker<T, D>(169linker: &mut wasmtime::component::Linker<T>,170host_getter: fn(&mut T) -> D::Data<'_>,171) -> wasmtime::Result<()>172where173D: foo::foo::lists::HostWithStore + Send,174for<'a> D::Data<'a>: foo::foo::lists::Host + Send,175T: 'static + Send,176{177foo::foo::lists::add_to_linker::<T, D>(linker, host_getter)?;178Ok(())179}180pub fn foo_foo_lists(&self) -> &exports::foo::foo::lists::Guest {181&self.interface0182}183}184};185pub mod foo {186pub mod foo {187#[allow(clippy::all)]188pub mod lists {189#[allow(unused_imports)]190use wasmtime::component::__internal::Box;191#[derive(wasmtime::component::ComponentType)]192#[derive(wasmtime::component::Lift)]193#[derive(wasmtime::component::Lower)]194#[component(record)]195#[derive(Clone)]196pub struct OtherRecord {197#[component(name = "a1")]198pub a1: u32,199#[component(name = "a2")]200pub a2: u64,201#[component(name = "a3")]202pub a3: i32,203#[component(name = "a4")]204pub a4: i64,205#[component(name = "b")]206pub b: wasmtime::component::__internal::String,207#[component(name = "c")]208pub c: wasmtime::component::__internal::Vec<u8>,209}210impl core::fmt::Debug for OtherRecord {211fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {212f.debug_struct("OtherRecord")213.field("a1", &self.a1)214.field("a2", &self.a2)215.field("a3", &self.a3)216.field("a4", &self.a4)217.field("b", &self.b)218.field("c", &self.c)219.finish()220}221}222const _: () = {223assert!(22448 == < OtherRecord as wasmtime::component::ComponentType >::SIZE32225);226assert!(2278 == < OtherRecord as wasmtime::component::ComponentType >::ALIGN32228);229};230#[derive(wasmtime::component::ComponentType)]231#[derive(wasmtime::component::Lift)]232#[derive(wasmtime::component::Lower)]233#[component(record)]234#[derive(Clone)]235pub struct SomeRecord {236#[component(name = "x")]237pub x: wasmtime::component::__internal::String,238#[component(name = "y")]239pub y: OtherRecord,240#[component(name = "z")]241pub z: wasmtime::component::__internal::Vec<OtherRecord>,242#[component(name = "c1")]243pub c1: u32,244#[component(name = "c2")]245pub c2: u64,246#[component(name = "c3")]247pub c3: i32,248#[component(name = "c4")]249pub c4: i64,250}251impl core::fmt::Debug for SomeRecord {252fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {253f.debug_struct("SomeRecord")254.field("x", &self.x)255.field("y", &self.y)256.field("z", &self.z)257.field("c1", &self.c1)258.field("c2", &self.c2)259.field("c3", &self.c3)260.field("c4", &self.c4)261.finish()262}263}264const _: () = {265assert!(26696 == < SomeRecord as wasmtime::component::ComponentType >::SIZE32267);268assert!(2698 == < SomeRecord as wasmtime::component::ComponentType >::ALIGN32270);271};272#[derive(wasmtime::component::ComponentType)]273#[derive(wasmtime::component::Lift)]274#[derive(wasmtime::component::Lower)]275#[component(variant)]276#[derive(Clone)]277pub enum OtherVariant {278#[component(name = "a")]279A,280#[component(name = "b")]281B(u32),282#[component(name = "c")]283C(wasmtime::component::__internal::String),284}285impl core::fmt::Debug for OtherVariant {286fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {287match self {288OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),289OtherVariant::B(e) => {290f.debug_tuple("OtherVariant::B").field(e).finish()291}292OtherVariant::C(e) => {293f.debug_tuple("OtherVariant::C").field(e).finish()294}295}296}297}298const _: () = {299assert!(30012 == < OtherVariant as wasmtime::component::ComponentType >::SIZE32301);302assert!(3034 == < OtherVariant as wasmtime::component::ComponentType >::ALIGN32304);305};306#[derive(wasmtime::component::ComponentType)]307#[derive(wasmtime::component::Lift)]308#[derive(wasmtime::component::Lower)]309#[component(variant)]310#[derive(Clone)]311pub enum SomeVariant {312#[component(name = "a")]313A(wasmtime::component::__internal::String),314#[component(name = "b")]315B,316#[component(name = "c")]317C(u32),318#[component(name = "d")]319D(wasmtime::component::__internal::Vec<OtherVariant>),320}321impl core::fmt::Debug for SomeVariant {322fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {323match self {324SomeVariant::A(e) => {325f.debug_tuple("SomeVariant::A").field(e).finish()326}327SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),328SomeVariant::C(e) => {329f.debug_tuple("SomeVariant::C").field(e).finish()330}331SomeVariant::D(e) => {332f.debug_tuple("SomeVariant::D").field(e).finish()333}334}335}336}337const _: () = {338assert!(33912 == < SomeVariant as wasmtime::component::ComponentType >::SIZE32340);341assert!(3424 == < SomeVariant as wasmtime::component::ComponentType >::ALIGN32343);344};345pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<346(347wasmtime::component::__internal::String,348u8,349i8,350u16,351i16,352u32,353i32,354u64,355i64,356f32,357f64,358char,359),360>;361const _: () = {362assert!(3638 == < LoadStoreAllSizes as wasmtime::component::ComponentType364>::SIZE32365);366assert!(3674 == < LoadStoreAllSizes as wasmtime::component::ComponentType368>::ALIGN32369);370};371pub trait HostWithStore: wasmtime::component::HasData + Send {}372impl<_T: ?Sized> HostWithStore for _T373where374_T: wasmtime::component::HasData + Send,375{}376pub trait Host: Send {377fn list_u8_param(378&mut self,379x: wasmtime::component::__internal::Vec<u8>,380) -> impl ::core::future::Future<Output = ()> + Send;381fn list_u16_param(382&mut self,383x: wasmtime::component::__internal::Vec<u16>,384) -> impl ::core::future::Future<Output = ()> + Send;385fn list_u32_param(386&mut self,387x: wasmtime::component::__internal::Vec<u32>,388) -> impl ::core::future::Future<Output = ()> + Send;389fn list_u64_param(390&mut self,391x: wasmtime::component::__internal::Vec<u64>,392) -> impl ::core::future::Future<Output = ()> + Send;393fn list_s8_param(394&mut self,395x: wasmtime::component::__internal::Vec<i8>,396) -> impl ::core::future::Future<Output = ()> + Send;397fn list_s16_param(398&mut self,399x: wasmtime::component::__internal::Vec<i16>,400) -> impl ::core::future::Future<Output = ()> + Send;401fn list_s32_param(402&mut self,403x: wasmtime::component::__internal::Vec<i32>,404) -> impl ::core::future::Future<Output = ()> + Send;405fn list_s64_param(406&mut self,407x: wasmtime::component::__internal::Vec<i64>,408) -> impl ::core::future::Future<Output = ()> + Send;409fn list_f32_param(410&mut self,411x: wasmtime::component::__internal::Vec<f32>,412) -> impl ::core::future::Future<Output = ()> + Send;413fn list_f64_param(414&mut self,415x: wasmtime::component::__internal::Vec<f64>,416) -> impl ::core::future::Future<Output = ()> + Send;417fn list_u8_ret(418&mut self,419) -> impl ::core::future::Future<420Output = wasmtime::component::__internal::Vec<u8>,421> + Send;422fn list_u16_ret(423&mut self,424) -> impl ::core::future::Future<425Output = wasmtime::component::__internal::Vec<u16>,426> + Send;427fn list_u32_ret(428&mut self,429) -> impl ::core::future::Future<430Output = wasmtime::component::__internal::Vec<u32>,431> + Send;432fn list_u64_ret(433&mut self,434) -> impl ::core::future::Future<435Output = wasmtime::component::__internal::Vec<u64>,436> + Send;437fn list_s8_ret(438&mut self,439) -> impl ::core::future::Future<440Output = wasmtime::component::__internal::Vec<i8>,441> + Send;442fn list_s16_ret(443&mut self,444) -> impl ::core::future::Future<445Output = wasmtime::component::__internal::Vec<i16>,446> + Send;447fn list_s32_ret(448&mut self,449) -> impl ::core::future::Future<450Output = wasmtime::component::__internal::Vec<i32>,451> + Send;452fn list_s64_ret(453&mut self,454) -> impl ::core::future::Future<455Output = wasmtime::component::__internal::Vec<i64>,456> + Send;457fn list_f32_ret(458&mut self,459) -> impl ::core::future::Future<460Output = wasmtime::component::__internal::Vec<f32>,461> + Send;462fn list_f64_ret(463&mut self,464) -> impl ::core::future::Future<465Output = wasmtime::component::__internal::Vec<f64>,466> + Send;467fn tuple_list(468&mut self,469x: wasmtime::component::__internal::Vec<(u8, i8)>,470) -> impl ::core::future::Future<471Output = wasmtime::component::__internal::Vec<(i64, u32)>,472> + Send;473fn string_list_arg(474&mut self,475a: wasmtime::component::__internal::Vec<476wasmtime::component::__internal::String,477>,478) -> impl ::core::future::Future<Output = ()> + Send;479fn string_list_ret(480&mut self,481) -> impl ::core::future::Future<482Output = wasmtime::component::__internal::Vec<483wasmtime::component::__internal::String,484>,485> + Send;486fn tuple_string_list(487&mut self,488x: wasmtime::component::__internal::Vec<489(u8, wasmtime::component::__internal::String),490>,491) -> impl ::core::future::Future<492Output = wasmtime::component::__internal::Vec<493(wasmtime::component::__internal::String, u8),494>,495> + Send;496fn string_list(497&mut self,498x: wasmtime::component::__internal::Vec<499wasmtime::component::__internal::String,500>,501) -> impl ::core::future::Future<502Output = wasmtime::component::__internal::Vec<503wasmtime::component::__internal::String,504>,505> + Send;506fn record_list(507&mut self,508x: wasmtime::component::__internal::Vec<SomeRecord>,509) -> impl ::core::future::Future<510Output = wasmtime::component::__internal::Vec<OtherRecord>,511> + Send;512fn record_list_reverse(513&mut self,514x: wasmtime::component::__internal::Vec<OtherRecord>,515) -> impl ::core::future::Future<516Output = wasmtime::component::__internal::Vec<SomeRecord>,517> + Send;518fn variant_list(519&mut self,520x: wasmtime::component::__internal::Vec<SomeVariant>,521) -> impl ::core::future::Future<522Output = wasmtime::component::__internal::Vec<OtherVariant>,523> + Send;524fn load_store_everything(525&mut self,526a: LoadStoreAllSizes,527) -> impl ::core::future::Future<Output = LoadStoreAllSizes> + Send;528}529impl<_T: Host + ?Sized + Send> Host for &mut _T {530fn list_u8_param(531&mut self,532x: wasmtime::component::__internal::Vec<u8>,533) -> impl ::core::future::Future<Output = ()> + Send {534async move { Host::list_u8_param(*self, x).await }535}536fn list_u16_param(537&mut self,538x: wasmtime::component::__internal::Vec<u16>,539) -> impl ::core::future::Future<Output = ()> + Send {540async move { Host::list_u16_param(*self, x).await }541}542fn list_u32_param(543&mut self,544x: wasmtime::component::__internal::Vec<u32>,545) -> impl ::core::future::Future<Output = ()> + Send {546async move { Host::list_u32_param(*self, x).await }547}548fn list_u64_param(549&mut self,550x: wasmtime::component::__internal::Vec<u64>,551) -> impl ::core::future::Future<Output = ()> + Send {552async move { Host::list_u64_param(*self, x).await }553}554fn list_s8_param(555&mut self,556x: wasmtime::component::__internal::Vec<i8>,557) -> impl ::core::future::Future<Output = ()> + Send {558async move { Host::list_s8_param(*self, x).await }559}560fn list_s16_param(561&mut self,562x: wasmtime::component::__internal::Vec<i16>,563) -> impl ::core::future::Future<Output = ()> + Send {564async move { Host::list_s16_param(*self, x).await }565}566fn list_s32_param(567&mut self,568x: wasmtime::component::__internal::Vec<i32>,569) -> impl ::core::future::Future<Output = ()> + Send {570async move { Host::list_s32_param(*self, x).await }571}572fn list_s64_param(573&mut self,574x: wasmtime::component::__internal::Vec<i64>,575) -> impl ::core::future::Future<Output = ()> + Send {576async move { Host::list_s64_param(*self, x).await }577}578fn list_f32_param(579&mut self,580x: wasmtime::component::__internal::Vec<f32>,581) -> impl ::core::future::Future<Output = ()> + Send {582async move { Host::list_f32_param(*self, x).await }583}584fn list_f64_param(585&mut self,586x: wasmtime::component::__internal::Vec<f64>,587) -> impl ::core::future::Future<Output = ()> + Send {588async move { Host::list_f64_param(*self, x).await }589}590fn list_u8_ret(591&mut self,592) -> impl ::core::future::Future<593Output = wasmtime::component::__internal::Vec<u8>,594> + Send {595async move { Host::list_u8_ret(*self).await }596}597fn list_u16_ret(598&mut self,599) -> impl ::core::future::Future<600Output = wasmtime::component::__internal::Vec<u16>,601> + Send {602async move { Host::list_u16_ret(*self).await }603}604fn list_u32_ret(605&mut self,606) -> impl ::core::future::Future<607Output = wasmtime::component::__internal::Vec<u32>,608> + Send {609async move { Host::list_u32_ret(*self).await }610}611fn list_u64_ret(612&mut self,613) -> impl ::core::future::Future<614Output = wasmtime::component::__internal::Vec<u64>,615> + Send {616async move { Host::list_u64_ret(*self).await }617}618fn list_s8_ret(619&mut self,620) -> impl ::core::future::Future<621Output = wasmtime::component::__internal::Vec<i8>,622> + Send {623async move { Host::list_s8_ret(*self).await }624}625fn list_s16_ret(626&mut self,627) -> impl ::core::future::Future<628Output = wasmtime::component::__internal::Vec<i16>,629> + Send {630async move { Host::list_s16_ret(*self).await }631}632fn list_s32_ret(633&mut self,634) -> impl ::core::future::Future<635Output = wasmtime::component::__internal::Vec<i32>,636> + Send {637async move { Host::list_s32_ret(*self).await }638}639fn list_s64_ret(640&mut self,641) -> impl ::core::future::Future<642Output = wasmtime::component::__internal::Vec<i64>,643> + Send {644async move { Host::list_s64_ret(*self).await }645}646fn list_f32_ret(647&mut self,648) -> impl ::core::future::Future<649Output = wasmtime::component::__internal::Vec<f32>,650> + Send {651async move { Host::list_f32_ret(*self).await }652}653fn list_f64_ret(654&mut self,655) -> impl ::core::future::Future<656Output = wasmtime::component::__internal::Vec<f64>,657> + Send {658async move { Host::list_f64_ret(*self).await }659}660fn tuple_list(661&mut self,662x: wasmtime::component::__internal::Vec<(u8, i8)>,663) -> impl ::core::future::Future<664Output = wasmtime::component::__internal::Vec<(i64, u32)>,665> + Send {666async move { Host::tuple_list(*self, x).await }667}668fn string_list_arg(669&mut self,670a: wasmtime::component::__internal::Vec<671wasmtime::component::__internal::String,672>,673) -> impl ::core::future::Future<Output = ()> + Send {674async move { Host::string_list_arg(*self, a).await }675}676fn string_list_ret(677&mut self,678) -> impl ::core::future::Future<679Output = wasmtime::component::__internal::Vec<680wasmtime::component::__internal::String,681>,682> + Send {683async move { Host::string_list_ret(*self).await }684}685fn tuple_string_list(686&mut self,687x: wasmtime::component::__internal::Vec<688(u8, wasmtime::component::__internal::String),689>,690) -> impl ::core::future::Future<691Output = wasmtime::component::__internal::Vec<692(wasmtime::component::__internal::String, u8),693>,694> + Send {695async move { Host::tuple_string_list(*self, x).await }696}697fn string_list(698&mut self,699x: wasmtime::component::__internal::Vec<700wasmtime::component::__internal::String,701>,702) -> impl ::core::future::Future<703Output = wasmtime::component::__internal::Vec<704wasmtime::component::__internal::String,705>,706> + Send {707async move { Host::string_list(*self, x).await }708}709fn record_list(710&mut self,711x: wasmtime::component::__internal::Vec<SomeRecord>,712) -> impl ::core::future::Future<713Output = wasmtime::component::__internal::Vec<OtherRecord>,714> + Send {715async move { Host::record_list(*self, x).await }716}717fn record_list_reverse(718&mut self,719x: wasmtime::component::__internal::Vec<OtherRecord>,720) -> impl ::core::future::Future<721Output = wasmtime::component::__internal::Vec<SomeRecord>,722> + Send {723async move { Host::record_list_reverse(*self, x).await }724}725fn variant_list(726&mut self,727x: wasmtime::component::__internal::Vec<SomeVariant>,728) -> impl ::core::future::Future<729Output = wasmtime::component::__internal::Vec<OtherVariant>,730> + Send {731async move { Host::variant_list(*self, x).await }732}733fn load_store_everything(734&mut self,735a: LoadStoreAllSizes,736) -> impl ::core::future::Future<Output = LoadStoreAllSizes> + Send {737async move { Host::load_store_everything(*self, a).await }738}739}740pub fn add_to_linker<T, D>(741linker: &mut wasmtime::component::Linker<T>,742host_getter: fn(&mut T) -> D::Data<'_>,743) -> wasmtime::Result<()>744where745D: HostWithStore,746for<'a> D::Data<'a>: Host,747T: 'static + Send,748{749let mut inst = linker.instance("foo:foo/lists")?;750inst.func_wrap_async(751"list-u8-param",752move |753mut caller: wasmtime::StoreContextMut<'_, T>,754(arg0,): (wasmtime::component::__internal::Vec<u8>,)|755{756wasmtime::component::__internal::Box::new(async move {757let host = &mut host_getter(caller.data_mut());758let r = Host::list_u8_param(host, arg0).await;759Ok(r)760})761},762)?;763inst.func_wrap_async(764"list-u16-param",765move |766mut caller: wasmtime::StoreContextMut<'_, T>,767(arg0,): (wasmtime::component::__internal::Vec<u16>,)|768{769wasmtime::component::__internal::Box::new(async move {770let host = &mut host_getter(caller.data_mut());771let r = Host::list_u16_param(host, arg0).await;772Ok(r)773})774},775)?;776inst.func_wrap_async(777"list-u32-param",778move |779mut caller: wasmtime::StoreContextMut<'_, T>,780(arg0,): (wasmtime::component::__internal::Vec<u32>,)|781{782wasmtime::component::__internal::Box::new(async move {783let host = &mut host_getter(caller.data_mut());784let r = Host::list_u32_param(host, arg0).await;785Ok(r)786})787},788)?;789inst.func_wrap_async(790"list-u64-param",791move |792mut caller: wasmtime::StoreContextMut<'_, T>,793(arg0,): (wasmtime::component::__internal::Vec<u64>,)|794{795wasmtime::component::__internal::Box::new(async move {796let host = &mut host_getter(caller.data_mut());797let r = Host::list_u64_param(host, arg0).await;798Ok(r)799})800},801)?;802inst.func_wrap_async(803"list-s8-param",804move |805mut caller: wasmtime::StoreContextMut<'_, T>,806(arg0,): (wasmtime::component::__internal::Vec<i8>,)|807{808wasmtime::component::__internal::Box::new(async move {809let host = &mut host_getter(caller.data_mut());810let r = Host::list_s8_param(host, arg0).await;811Ok(r)812})813},814)?;815inst.func_wrap_async(816"list-s16-param",817move |818mut caller: wasmtime::StoreContextMut<'_, T>,819(arg0,): (wasmtime::component::__internal::Vec<i16>,)|820{821wasmtime::component::__internal::Box::new(async move {822let host = &mut host_getter(caller.data_mut());823let r = Host::list_s16_param(host, arg0).await;824Ok(r)825})826},827)?;828inst.func_wrap_async(829"list-s32-param",830move |831mut caller: wasmtime::StoreContextMut<'_, T>,832(arg0,): (wasmtime::component::__internal::Vec<i32>,)|833{834wasmtime::component::__internal::Box::new(async move {835let host = &mut host_getter(caller.data_mut());836let r = Host::list_s32_param(host, arg0).await;837Ok(r)838})839},840)?;841inst.func_wrap_async(842"list-s64-param",843move |844mut caller: wasmtime::StoreContextMut<'_, T>,845(arg0,): (wasmtime::component::__internal::Vec<i64>,)|846{847wasmtime::component::__internal::Box::new(async move {848let host = &mut host_getter(caller.data_mut());849let r = Host::list_s64_param(host, arg0).await;850Ok(r)851})852},853)?;854inst.func_wrap_async(855"list-f32-param",856move |857mut caller: wasmtime::StoreContextMut<'_, T>,858(arg0,): (wasmtime::component::__internal::Vec<f32>,)|859{860wasmtime::component::__internal::Box::new(async move {861let host = &mut host_getter(caller.data_mut());862let r = Host::list_f32_param(host, arg0).await;863Ok(r)864})865},866)?;867inst.func_wrap_async(868"list-f64-param",869move |870mut caller: wasmtime::StoreContextMut<'_, T>,871(arg0,): (wasmtime::component::__internal::Vec<f64>,)|872{873wasmtime::component::__internal::Box::new(async move {874let host = &mut host_getter(caller.data_mut());875let r = Host::list_f64_param(host, arg0).await;876Ok(r)877})878},879)?;880inst.func_wrap_async(881"list-u8-ret",882move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {883wasmtime::component::__internal::Box::new(async move {884let host = &mut host_getter(caller.data_mut());885let r = Host::list_u8_ret(host).await;886Ok((r,))887})888},889)?;890inst.func_wrap_async(891"list-u16-ret",892move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {893wasmtime::component::__internal::Box::new(async move {894let host = &mut host_getter(caller.data_mut());895let r = Host::list_u16_ret(host).await;896Ok((r,))897})898},899)?;900inst.func_wrap_async(901"list-u32-ret",902move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {903wasmtime::component::__internal::Box::new(async move {904let host = &mut host_getter(caller.data_mut());905let r = Host::list_u32_ret(host).await;906Ok((r,))907})908},909)?;910inst.func_wrap_async(911"list-u64-ret",912move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {913wasmtime::component::__internal::Box::new(async move {914let host = &mut host_getter(caller.data_mut());915let r = Host::list_u64_ret(host).await;916Ok((r,))917})918},919)?;920inst.func_wrap_async(921"list-s8-ret",922move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {923wasmtime::component::__internal::Box::new(async move {924let host = &mut host_getter(caller.data_mut());925let r = Host::list_s8_ret(host).await;926Ok((r,))927})928},929)?;930inst.func_wrap_async(931"list-s16-ret",932move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {933wasmtime::component::__internal::Box::new(async move {934let host = &mut host_getter(caller.data_mut());935let r = Host::list_s16_ret(host).await;936Ok((r,))937})938},939)?;940inst.func_wrap_async(941"list-s32-ret",942move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {943wasmtime::component::__internal::Box::new(async move {944let host = &mut host_getter(caller.data_mut());945let r = Host::list_s32_ret(host).await;946Ok((r,))947})948},949)?;950inst.func_wrap_async(951"list-s64-ret",952move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {953wasmtime::component::__internal::Box::new(async move {954let host = &mut host_getter(caller.data_mut());955let r = Host::list_s64_ret(host).await;956Ok((r,))957})958},959)?;960inst.func_wrap_async(961"list-f32-ret",962move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {963wasmtime::component::__internal::Box::new(async move {964let host = &mut host_getter(caller.data_mut());965let r = Host::list_f32_ret(host).await;966Ok((r,))967})968},969)?;970inst.func_wrap_async(971"list-f64-ret",972move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {973wasmtime::component::__internal::Box::new(async move {974let host = &mut host_getter(caller.data_mut());975let r = Host::list_f64_ret(host).await;976Ok((r,))977})978},979)?;980inst.func_wrap_async(981"tuple-list",982move |983mut caller: wasmtime::StoreContextMut<'_, T>,984(arg0,): (wasmtime::component::__internal::Vec<(u8, i8)>,)|985{986wasmtime::component::__internal::Box::new(async move {987let host = &mut host_getter(caller.data_mut());988let r = Host::tuple_list(host, arg0).await;989Ok((r,))990})991},992)?;993inst.func_wrap_async(994"string-list-arg",995move |996mut caller: wasmtime::StoreContextMut<'_, T>,997(998arg0,999): (1000wasmtime::component::__internal::Vec<1001wasmtime::component::__internal::String,1002>,1003)|1004{1005wasmtime::component::__internal::Box::new(async move {1006let host = &mut host_getter(caller.data_mut());1007let r = Host::string_list_arg(host, arg0).await;1008Ok(r)1009})1010},1011)?;1012inst.func_wrap_async(1013"string-list-ret",1014move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1015wasmtime::component::__internal::Box::new(async move {1016let host = &mut host_getter(caller.data_mut());1017let r = Host::string_list_ret(host).await;1018Ok((r,))1019})1020},1021)?;1022inst.func_wrap_async(1023"tuple-string-list",1024move |1025mut caller: wasmtime::StoreContextMut<'_, T>,1026(1027arg0,1028): (1029wasmtime::component::__internal::Vec<1030(u8, wasmtime::component::__internal::String),1031>,1032)|1033{1034wasmtime::component::__internal::Box::new(async move {1035let host = &mut host_getter(caller.data_mut());1036let r = Host::tuple_string_list(host, arg0).await;1037Ok((r,))1038})1039},1040)?;1041inst.func_wrap_async(1042"string-list",1043move |1044mut caller: wasmtime::StoreContextMut<'_, T>,1045(1046arg0,1047): (1048wasmtime::component::__internal::Vec<1049wasmtime::component::__internal::String,1050>,1051)|1052{1053wasmtime::component::__internal::Box::new(async move {1054let host = &mut host_getter(caller.data_mut());1055let r = Host::string_list(host, arg0).await;1056Ok((r,))1057})1058},1059)?;1060inst.func_wrap_async(1061"record-list",1062move |1063mut caller: wasmtime::StoreContextMut<'_, T>,1064(arg0,): (wasmtime::component::__internal::Vec<SomeRecord>,)|1065{1066wasmtime::component::__internal::Box::new(async move {1067let host = &mut host_getter(caller.data_mut());1068let r = Host::record_list(host, arg0).await;1069Ok((r,))1070})1071},1072)?;1073inst.func_wrap_async(1074"record-list-reverse",1075move |1076mut caller: wasmtime::StoreContextMut<'_, T>,1077(arg0,): (wasmtime::component::__internal::Vec<OtherRecord>,)|1078{1079wasmtime::component::__internal::Box::new(async move {1080let host = &mut host_getter(caller.data_mut());1081let r = Host::record_list_reverse(host, arg0).await;1082Ok((r,))1083})1084},1085)?;1086inst.func_wrap_async(1087"variant-list",1088move |1089mut caller: wasmtime::StoreContextMut<'_, T>,1090(arg0,): (wasmtime::component::__internal::Vec<SomeVariant>,)|1091{1092wasmtime::component::__internal::Box::new(async move {1093let host = &mut host_getter(caller.data_mut());1094let r = Host::variant_list(host, arg0).await;1095Ok((r,))1096})1097},1098)?;1099inst.func_wrap_async(1100"load-store-everything",1101move |1102mut caller: wasmtime::StoreContextMut<'_, T>,1103(arg0,): (LoadStoreAllSizes,)|1104{1105wasmtime::component::__internal::Box::new(async move {1106let host = &mut host_getter(caller.data_mut());1107let r = Host::load_store_everything(host, arg0).await;1108Ok((r,))1109})1110},1111)?;1112Ok(())1113}1114}1115}1116}1117pub mod exports {1118pub mod foo {1119pub mod foo {1120#[allow(clippy::all)]1121pub mod lists {1122#[allow(unused_imports)]1123use wasmtime::component::__internal::Box;1124#[derive(wasmtime::component::ComponentType)]1125#[derive(wasmtime::component::Lift)]1126#[derive(wasmtime::component::Lower)]1127#[component(record)]1128#[derive(Clone)]1129pub struct OtherRecord {1130#[component(name = "a1")]1131pub a1: u32,1132#[component(name = "a2")]1133pub a2: u64,1134#[component(name = "a3")]1135pub a3: i32,1136#[component(name = "a4")]1137pub a4: i64,1138#[component(name = "b")]1139pub b: wasmtime::component::__internal::String,1140#[component(name = "c")]1141pub c: wasmtime::component::__internal::Vec<u8>,1142}1143impl core::fmt::Debug for OtherRecord {1144fn fmt(1145&self,1146f: &mut core::fmt::Formatter<'_>,1147) -> core::fmt::Result {1148f.debug_struct("OtherRecord")1149.field("a1", &self.a1)1150.field("a2", &self.a2)1151.field("a3", &self.a3)1152.field("a4", &self.a4)1153.field("b", &self.b)1154.field("c", &self.c)1155.finish()1156}1157}1158const _: () = {1159assert!(116048 == < OtherRecord as wasmtime::component::ComponentType1161>::SIZE321162);1163assert!(11648 == < OtherRecord as wasmtime::component::ComponentType1165>::ALIGN321166);1167};1168#[derive(wasmtime::component::ComponentType)]1169#[derive(wasmtime::component::Lift)]1170#[derive(wasmtime::component::Lower)]1171#[component(record)]1172#[derive(Clone)]1173pub struct SomeRecord {1174#[component(name = "x")]1175pub x: wasmtime::component::__internal::String,1176#[component(name = "y")]1177pub y: OtherRecord,1178#[component(name = "z")]1179pub z: wasmtime::component::__internal::Vec<OtherRecord>,1180#[component(name = "c1")]1181pub c1: u32,1182#[component(name = "c2")]1183pub c2: u64,1184#[component(name = "c3")]1185pub c3: i32,1186#[component(name = "c4")]1187pub c4: i64,1188}1189impl core::fmt::Debug for SomeRecord {1190fn fmt(1191&self,1192f: &mut core::fmt::Formatter<'_>,1193) -> core::fmt::Result {1194f.debug_struct("SomeRecord")1195.field("x", &self.x)1196.field("y", &self.y)1197.field("z", &self.z)1198.field("c1", &self.c1)1199.field("c2", &self.c2)1200.field("c3", &self.c3)1201.field("c4", &self.c4)1202.finish()1203}1204}1205const _: () = {1206assert!(120796 == < SomeRecord as wasmtime::component::ComponentType1208>::SIZE321209);1210assert!(12118 == < SomeRecord as wasmtime::component::ComponentType1212>::ALIGN321213);1214};1215#[derive(wasmtime::component::ComponentType)]1216#[derive(wasmtime::component::Lift)]1217#[derive(wasmtime::component::Lower)]1218#[component(variant)]1219#[derive(Clone)]1220pub enum OtherVariant {1221#[component(name = "a")]1222A,1223#[component(name = "b")]1224B(u32),1225#[component(name = "c")]1226C(wasmtime::component::__internal::String),1227}1228impl core::fmt::Debug for OtherVariant {1229fn fmt(1230&self,1231f: &mut core::fmt::Formatter<'_>,1232) -> core::fmt::Result {1233match self {1234OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),1235OtherVariant::B(e) => {1236f.debug_tuple("OtherVariant::B").field(e).finish()1237}1238OtherVariant::C(e) => {1239f.debug_tuple("OtherVariant::C").field(e).finish()1240}1241}1242}1243}1244const _: () = {1245assert!(124612 == < OtherVariant as wasmtime::component::ComponentType1247>::SIZE321248);1249assert!(12504 == < OtherVariant as wasmtime::component::ComponentType1251>::ALIGN321252);1253};1254#[derive(wasmtime::component::ComponentType)]1255#[derive(wasmtime::component::Lift)]1256#[derive(wasmtime::component::Lower)]1257#[component(variant)]1258#[derive(Clone)]1259pub enum SomeVariant {1260#[component(name = "a")]1261A(wasmtime::component::__internal::String),1262#[component(name = "b")]1263B,1264#[component(name = "c")]1265C(u32),1266#[component(name = "d")]1267D(wasmtime::component::__internal::Vec<OtherVariant>),1268}1269impl core::fmt::Debug for SomeVariant {1270fn fmt(1271&self,1272f: &mut core::fmt::Formatter<'_>,1273) -> core::fmt::Result {1274match self {1275SomeVariant::A(e) => {1276f.debug_tuple("SomeVariant::A").field(e).finish()1277}1278SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),1279SomeVariant::C(e) => {1280f.debug_tuple("SomeVariant::C").field(e).finish()1281}1282SomeVariant::D(e) => {1283f.debug_tuple("SomeVariant::D").field(e).finish()1284}1285}1286}1287}1288const _: () = {1289assert!(129012 == < SomeVariant as wasmtime::component::ComponentType1291>::SIZE321292);1293assert!(12944 == < SomeVariant as wasmtime::component::ComponentType1295>::ALIGN321296);1297};1298pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<1299(1300wasmtime::component::__internal::String,1301u8,1302i8,1303u16,1304i16,1305u32,1306i32,1307u64,1308i64,1309f32,1310f64,1311char,1312),1313>;1314const _: () = {1315assert!(13168 == < LoadStoreAllSizes as wasmtime::component::ComponentType1317>::SIZE321318);1319assert!(13204 == < LoadStoreAllSizes as wasmtime::component::ComponentType1321>::ALIGN321322);1323};1324#[derive(Clone)]1325pub struct Guest {1326list_u8_param: wasmtime::component::Func,1327list_u16_param: wasmtime::component::Func,1328list_u32_param: wasmtime::component::Func,1329list_u64_param: wasmtime::component::Func,1330list_s8_param: wasmtime::component::Func,1331list_s16_param: wasmtime::component::Func,1332list_s32_param: wasmtime::component::Func,1333list_s64_param: wasmtime::component::Func,1334list_f32_param: wasmtime::component::Func,1335list_f64_param: wasmtime::component::Func,1336list_u8_ret: wasmtime::component::Func,1337list_u16_ret: wasmtime::component::Func,1338list_u32_ret: wasmtime::component::Func,1339list_u64_ret: wasmtime::component::Func,1340list_s8_ret: wasmtime::component::Func,1341list_s16_ret: wasmtime::component::Func,1342list_s32_ret: wasmtime::component::Func,1343list_s64_ret: wasmtime::component::Func,1344list_f32_ret: wasmtime::component::Func,1345list_f64_ret: wasmtime::component::Func,1346tuple_list: wasmtime::component::Func,1347string_list_arg: wasmtime::component::Func,1348string_list_ret: wasmtime::component::Func,1349tuple_string_list: wasmtime::component::Func,1350string_list: wasmtime::component::Func,1351record_list: wasmtime::component::Func,1352record_list_reverse: wasmtime::component::Func,1353variant_list: wasmtime::component::Func,1354load_store_everything: wasmtime::component::Func,1355}1356#[derive(Clone)]1357pub struct GuestIndices {1358list_u8_param: wasmtime::component::ComponentExportIndex,1359list_u16_param: wasmtime::component::ComponentExportIndex,1360list_u32_param: wasmtime::component::ComponentExportIndex,1361list_u64_param: wasmtime::component::ComponentExportIndex,1362list_s8_param: wasmtime::component::ComponentExportIndex,1363list_s16_param: wasmtime::component::ComponentExportIndex,1364list_s32_param: wasmtime::component::ComponentExportIndex,1365list_s64_param: wasmtime::component::ComponentExportIndex,1366list_f32_param: wasmtime::component::ComponentExportIndex,1367list_f64_param: wasmtime::component::ComponentExportIndex,1368list_u8_ret: wasmtime::component::ComponentExportIndex,1369list_u16_ret: wasmtime::component::ComponentExportIndex,1370list_u32_ret: wasmtime::component::ComponentExportIndex,1371list_u64_ret: wasmtime::component::ComponentExportIndex,1372list_s8_ret: wasmtime::component::ComponentExportIndex,1373list_s16_ret: wasmtime::component::ComponentExportIndex,1374list_s32_ret: wasmtime::component::ComponentExportIndex,1375list_s64_ret: wasmtime::component::ComponentExportIndex,1376list_f32_ret: wasmtime::component::ComponentExportIndex,1377list_f64_ret: wasmtime::component::ComponentExportIndex,1378tuple_list: wasmtime::component::ComponentExportIndex,1379string_list_arg: wasmtime::component::ComponentExportIndex,1380string_list_ret: wasmtime::component::ComponentExportIndex,1381tuple_string_list: wasmtime::component::ComponentExportIndex,1382string_list: wasmtime::component::ComponentExportIndex,1383record_list: wasmtime::component::ComponentExportIndex,1384record_list_reverse: wasmtime::component::ComponentExportIndex,1385variant_list: wasmtime::component::ComponentExportIndex,1386load_store_everything: wasmtime::component::ComponentExportIndex,1387}1388impl GuestIndices {1389/// Constructor for [`GuestIndices`] which takes a1390/// [`Component`](wasmtime::component::Component) as input and can be executed1391/// before instantiation.1392///1393/// This constructor can be used to front-load string lookups to find exports1394/// within a component.1395pub fn new<_T>(1396_instance_pre: &wasmtime::component::InstancePre<_T>,1397) -> wasmtime::Result<GuestIndices> {1398let instance = _instance_pre1399.component()1400.get_export_index(None, "foo:foo/lists")1401.ok_or_else(|| {1402wasmtime::format_err!(1403"no exported instance named `foo:foo/lists`"1404)1405})?;1406let mut lookup = move |name| {1407_instance_pre1408.component()1409.get_export_index(Some(&instance), name)1410.ok_or_else(|| {1411wasmtime::format_err!(1412"instance export `foo:foo/lists` does \1413not have export `{name}`"1414)1415})1416};1417let _ = &mut lookup;1418let list_u8_param = lookup("list-u8-param")?;1419let list_u16_param = lookup("list-u16-param")?;1420let list_u32_param = lookup("list-u32-param")?;1421let list_u64_param = lookup("list-u64-param")?;1422let list_s8_param = lookup("list-s8-param")?;1423let list_s16_param = lookup("list-s16-param")?;1424let list_s32_param = lookup("list-s32-param")?;1425let list_s64_param = lookup("list-s64-param")?;1426let list_f32_param = lookup("list-f32-param")?;1427let list_f64_param = lookup("list-f64-param")?;1428let list_u8_ret = lookup("list-u8-ret")?;1429let list_u16_ret = lookup("list-u16-ret")?;1430let list_u32_ret = lookup("list-u32-ret")?;1431let list_u64_ret = lookup("list-u64-ret")?;1432let list_s8_ret = lookup("list-s8-ret")?;1433let list_s16_ret = lookup("list-s16-ret")?;1434let list_s32_ret = lookup("list-s32-ret")?;1435let list_s64_ret = lookup("list-s64-ret")?;1436let list_f32_ret = lookup("list-f32-ret")?;1437let list_f64_ret = lookup("list-f64-ret")?;1438let tuple_list = lookup("tuple-list")?;1439let string_list_arg = lookup("string-list-arg")?;1440let string_list_ret = lookup("string-list-ret")?;1441let tuple_string_list = lookup("tuple-string-list")?;1442let string_list = lookup("string-list")?;1443let record_list = lookup("record-list")?;1444let record_list_reverse = lookup("record-list-reverse")?;1445let variant_list = lookup("variant-list")?;1446let load_store_everything = lookup("load-store-everything")?;1447Ok(GuestIndices {1448list_u8_param,1449list_u16_param,1450list_u32_param,1451list_u64_param,1452list_s8_param,1453list_s16_param,1454list_s32_param,1455list_s64_param,1456list_f32_param,1457list_f64_param,1458list_u8_ret,1459list_u16_ret,1460list_u32_ret,1461list_u64_ret,1462list_s8_ret,1463list_s16_ret,1464list_s32_ret,1465list_s64_ret,1466list_f32_ret,1467list_f64_ret,1468tuple_list,1469string_list_arg,1470string_list_ret,1471tuple_string_list,1472string_list,1473record_list,1474record_list_reverse,1475variant_list,1476load_store_everything,1477})1478}1479pub fn load(1480&self,1481mut store: impl wasmtime::AsContextMut,1482instance: &wasmtime::component::Instance,1483) -> wasmtime::Result<Guest> {1484let _instance = instance;1485let _instance_pre = _instance.instance_pre(&store);1486let _instance_type = _instance_pre.instance_type();1487let mut store = store.as_context_mut();1488let _ = &mut store;1489let list_u8_param = *_instance1490.get_typed_func::<1491(&[u8],),1492(),1493>(&mut store, &self.list_u8_param)?1494.func();1495let list_u16_param = *_instance1496.get_typed_func::<1497(&[u16],),1498(),1499>(&mut store, &self.list_u16_param)?1500.func();1501let list_u32_param = *_instance1502.get_typed_func::<1503(&[u32],),1504(),1505>(&mut store, &self.list_u32_param)?1506.func();1507let list_u64_param = *_instance1508.get_typed_func::<1509(&[u64],),1510(),1511>(&mut store, &self.list_u64_param)?1512.func();1513let list_s8_param = *_instance1514.get_typed_func::<1515(&[i8],),1516(),1517>(&mut store, &self.list_s8_param)?1518.func();1519let list_s16_param = *_instance1520.get_typed_func::<1521(&[i16],),1522(),1523>(&mut store, &self.list_s16_param)?1524.func();1525let list_s32_param = *_instance1526.get_typed_func::<1527(&[i32],),1528(),1529>(&mut store, &self.list_s32_param)?1530.func();1531let list_s64_param = *_instance1532.get_typed_func::<1533(&[i64],),1534(),1535>(&mut store, &self.list_s64_param)?1536.func();1537let list_f32_param = *_instance1538.get_typed_func::<1539(&[f32],),1540(),1541>(&mut store, &self.list_f32_param)?1542.func();1543let list_f64_param = *_instance1544.get_typed_func::<1545(&[f64],),1546(),1547>(&mut store, &self.list_f64_param)?1548.func();1549let list_u8_ret = *_instance1550.get_typed_func::<1551(),1552(wasmtime::component::__internal::Vec<u8>,),1553>(&mut store, &self.list_u8_ret)?1554.func();1555let list_u16_ret = *_instance1556.get_typed_func::<1557(),1558(wasmtime::component::__internal::Vec<u16>,),1559>(&mut store, &self.list_u16_ret)?1560.func();1561let list_u32_ret = *_instance1562.get_typed_func::<1563(),1564(wasmtime::component::__internal::Vec<u32>,),1565>(&mut store, &self.list_u32_ret)?1566.func();1567let list_u64_ret = *_instance1568.get_typed_func::<1569(),1570(wasmtime::component::__internal::Vec<u64>,),1571>(&mut store, &self.list_u64_ret)?1572.func();1573let list_s8_ret = *_instance1574.get_typed_func::<1575(),1576(wasmtime::component::__internal::Vec<i8>,),1577>(&mut store, &self.list_s8_ret)?1578.func();1579let list_s16_ret = *_instance1580.get_typed_func::<1581(),1582(wasmtime::component::__internal::Vec<i16>,),1583>(&mut store, &self.list_s16_ret)?1584.func();1585let list_s32_ret = *_instance1586.get_typed_func::<1587(),1588(wasmtime::component::__internal::Vec<i32>,),1589>(&mut store, &self.list_s32_ret)?1590.func();1591let list_s64_ret = *_instance1592.get_typed_func::<1593(),1594(wasmtime::component::__internal::Vec<i64>,),1595>(&mut store, &self.list_s64_ret)?1596.func();1597let list_f32_ret = *_instance1598.get_typed_func::<1599(),1600(wasmtime::component::__internal::Vec<f32>,),1601>(&mut store, &self.list_f32_ret)?1602.func();1603let list_f64_ret = *_instance1604.get_typed_func::<1605(),1606(wasmtime::component::__internal::Vec<f64>,),1607>(&mut store, &self.list_f64_ret)?1608.func();1609let tuple_list = *_instance1610.get_typed_func::<1611(&[(u8, i8)],),1612(wasmtime::component::__internal::Vec<(i64, u32)>,),1613>(&mut store, &self.tuple_list)?1614.func();1615let string_list_arg = *_instance1616.get_typed_func::<1617(&[wasmtime::component::__internal::String],),1618(),1619>(&mut store, &self.string_list_arg)?1620.func();1621let string_list_ret = *_instance1622.get_typed_func::<1623(),1624(1625wasmtime::component::__internal::Vec<1626wasmtime::component::__internal::String,1627>,1628),1629>(&mut store, &self.string_list_ret)?1630.func();1631let tuple_string_list = *_instance1632.get_typed_func::<1633(&[(u8, wasmtime::component::__internal::String)],),1634(1635wasmtime::component::__internal::Vec<1636(wasmtime::component::__internal::String, u8),1637>,1638),1639>(&mut store, &self.tuple_string_list)?1640.func();1641let string_list = *_instance1642.get_typed_func::<1643(&[wasmtime::component::__internal::String],),1644(1645wasmtime::component::__internal::Vec<1646wasmtime::component::__internal::String,1647>,1648),1649>(&mut store, &self.string_list)?1650.func();1651let record_list = *_instance1652.get_typed_func::<1653(&[SomeRecord],),1654(wasmtime::component::__internal::Vec<OtherRecord>,),1655>(&mut store, &self.record_list)?1656.func();1657let record_list_reverse = *_instance1658.get_typed_func::<1659(&[OtherRecord],),1660(wasmtime::component::__internal::Vec<SomeRecord>,),1661>(&mut store, &self.record_list_reverse)?1662.func();1663let variant_list = *_instance1664.get_typed_func::<1665(&[SomeVariant],),1666(wasmtime::component::__internal::Vec<OtherVariant>,),1667>(&mut store, &self.variant_list)?1668.func();1669let load_store_everything = *_instance1670.get_typed_func::<1671(&LoadStoreAllSizes,),1672(LoadStoreAllSizes,),1673>(&mut store, &self.load_store_everything)?1674.func();1675Ok(Guest {1676list_u8_param,1677list_u16_param,1678list_u32_param,1679list_u64_param,1680list_s8_param,1681list_s16_param,1682list_s32_param,1683list_s64_param,1684list_f32_param,1685list_f64_param,1686list_u8_ret,1687list_u16_ret,1688list_u32_ret,1689list_u64_ret,1690list_s8_ret,1691list_s16_ret,1692list_s32_ret,1693list_s64_ret,1694list_f32_ret,1695list_f64_ret,1696tuple_list,1697string_list_arg,1698string_list_ret,1699tuple_string_list,1700string_list,1701record_list,1702record_list_reverse,1703variant_list,1704load_store_everything,1705})1706}1707}1708impl Guest {1709pub async fn call_list_u8_param<S: wasmtime::AsContextMut>(1710&self,1711mut store: S,1712arg0: &[u8],1713) -> wasmtime::Result<()>1714where1715<S as wasmtime::AsContext>::Data: Send,1716{1717let callee = unsafe {1718wasmtime::component::TypedFunc::<1719(&[u8],),1720(),1721>::new_unchecked(self.list_u8_param)1722};1723let () = callee1724.call_async(store.as_context_mut(), (arg0,))1725.await?;1726Ok(())1727}1728pub async fn call_list_u16_param<S: wasmtime::AsContextMut>(1729&self,1730mut store: S,1731arg0: &[u16],1732) -> wasmtime::Result<()>1733where1734<S as wasmtime::AsContext>::Data: Send,1735{1736let callee = unsafe {1737wasmtime::component::TypedFunc::<1738(&[u16],),1739(),1740>::new_unchecked(self.list_u16_param)1741};1742let () = callee1743.call_async(store.as_context_mut(), (arg0,))1744.await?;1745Ok(())1746}1747pub async fn call_list_u32_param<S: wasmtime::AsContextMut>(1748&self,1749mut store: S,1750arg0: &[u32],1751) -> wasmtime::Result<()>1752where1753<S as wasmtime::AsContext>::Data: Send,1754{1755let callee = unsafe {1756wasmtime::component::TypedFunc::<1757(&[u32],),1758(),1759>::new_unchecked(self.list_u32_param)1760};1761let () = callee1762.call_async(store.as_context_mut(), (arg0,))1763.await?;1764Ok(())1765}1766pub async fn call_list_u64_param<S: wasmtime::AsContextMut>(1767&self,1768mut store: S,1769arg0: &[u64],1770) -> wasmtime::Result<()>1771where1772<S as wasmtime::AsContext>::Data: Send,1773{1774let callee = unsafe {1775wasmtime::component::TypedFunc::<1776(&[u64],),1777(),1778>::new_unchecked(self.list_u64_param)1779};1780let () = callee1781.call_async(store.as_context_mut(), (arg0,))1782.await?;1783Ok(())1784}1785pub async fn call_list_s8_param<S: wasmtime::AsContextMut>(1786&self,1787mut store: S,1788arg0: &[i8],1789) -> wasmtime::Result<()>1790where1791<S as wasmtime::AsContext>::Data: Send,1792{1793let callee = unsafe {1794wasmtime::component::TypedFunc::<1795(&[i8],),1796(),1797>::new_unchecked(self.list_s8_param)1798};1799let () = callee1800.call_async(store.as_context_mut(), (arg0,))1801.await?;1802Ok(())1803}1804pub async fn call_list_s16_param<S: wasmtime::AsContextMut>(1805&self,1806mut store: S,1807arg0: &[i16],1808) -> wasmtime::Result<()>1809where1810<S as wasmtime::AsContext>::Data: Send,1811{1812let callee = unsafe {1813wasmtime::component::TypedFunc::<1814(&[i16],),1815(),1816>::new_unchecked(self.list_s16_param)1817};1818let () = callee1819.call_async(store.as_context_mut(), (arg0,))1820.await?;1821Ok(())1822}1823pub async fn call_list_s32_param<S: wasmtime::AsContextMut>(1824&self,1825mut store: S,1826arg0: &[i32],1827) -> wasmtime::Result<()>1828where1829<S as wasmtime::AsContext>::Data: Send,1830{1831let callee = unsafe {1832wasmtime::component::TypedFunc::<1833(&[i32],),1834(),1835>::new_unchecked(self.list_s32_param)1836};1837let () = callee1838.call_async(store.as_context_mut(), (arg0,))1839.await?;1840Ok(())1841}1842pub async fn call_list_s64_param<S: wasmtime::AsContextMut>(1843&self,1844mut store: S,1845arg0: &[i64],1846) -> wasmtime::Result<()>1847where1848<S as wasmtime::AsContext>::Data: Send,1849{1850let callee = unsafe {1851wasmtime::component::TypedFunc::<1852(&[i64],),1853(),1854>::new_unchecked(self.list_s64_param)1855};1856let () = callee1857.call_async(store.as_context_mut(), (arg0,))1858.await?;1859Ok(())1860}1861pub async fn call_list_f32_param<S: wasmtime::AsContextMut>(1862&self,1863mut store: S,1864arg0: &[f32],1865) -> wasmtime::Result<()>1866where1867<S as wasmtime::AsContext>::Data: Send,1868{1869let callee = unsafe {1870wasmtime::component::TypedFunc::<1871(&[f32],),1872(),1873>::new_unchecked(self.list_f32_param)1874};1875let () = callee1876.call_async(store.as_context_mut(), (arg0,))1877.await?;1878Ok(())1879}1880pub async fn call_list_f64_param<S: wasmtime::AsContextMut>(1881&self,1882mut store: S,1883arg0: &[f64],1884) -> wasmtime::Result<()>1885where1886<S as wasmtime::AsContext>::Data: Send,1887{1888let callee = unsafe {1889wasmtime::component::TypedFunc::<1890(&[f64],),1891(),1892>::new_unchecked(self.list_f64_param)1893};1894let () = callee1895.call_async(store.as_context_mut(), (arg0,))1896.await?;1897Ok(())1898}1899pub async fn call_list_u8_ret<S: wasmtime::AsContextMut>(1900&self,1901mut store: S,1902) -> wasmtime::Result<wasmtime::component::__internal::Vec<u8>>1903where1904<S as wasmtime::AsContext>::Data: Send,1905{1906let callee = unsafe {1907wasmtime::component::TypedFunc::<1908(),1909(wasmtime::component::__internal::Vec<u8>,),1910>::new_unchecked(self.list_u8_ret)1911};1912let (ret0,) = callee1913.call_async(store.as_context_mut(), ())1914.await?;1915Ok(ret0)1916}1917pub async fn call_list_u16_ret<S: wasmtime::AsContextMut>(1918&self,1919mut store: S,1920) -> wasmtime::Result<wasmtime::component::__internal::Vec<u16>>1921where1922<S as wasmtime::AsContext>::Data: Send,1923{1924let callee = unsafe {1925wasmtime::component::TypedFunc::<1926(),1927(wasmtime::component::__internal::Vec<u16>,),1928>::new_unchecked(self.list_u16_ret)1929};1930let (ret0,) = callee1931.call_async(store.as_context_mut(), ())1932.await?;1933Ok(ret0)1934}1935pub async fn call_list_u32_ret<S: wasmtime::AsContextMut>(1936&self,1937mut store: S,1938) -> wasmtime::Result<wasmtime::component::__internal::Vec<u32>>1939where1940<S as wasmtime::AsContext>::Data: Send,1941{1942let callee = unsafe {1943wasmtime::component::TypedFunc::<1944(),1945(wasmtime::component::__internal::Vec<u32>,),1946>::new_unchecked(self.list_u32_ret)1947};1948let (ret0,) = callee1949.call_async(store.as_context_mut(), ())1950.await?;1951Ok(ret0)1952}1953pub async fn call_list_u64_ret<S: wasmtime::AsContextMut>(1954&self,1955mut store: S,1956) -> wasmtime::Result<wasmtime::component::__internal::Vec<u64>>1957where1958<S as wasmtime::AsContext>::Data: Send,1959{1960let callee = unsafe {1961wasmtime::component::TypedFunc::<1962(),1963(wasmtime::component::__internal::Vec<u64>,),1964>::new_unchecked(self.list_u64_ret)1965};1966let (ret0,) = callee1967.call_async(store.as_context_mut(), ())1968.await?;1969Ok(ret0)1970}1971pub async fn call_list_s8_ret<S: wasmtime::AsContextMut>(1972&self,1973mut store: S,1974) -> wasmtime::Result<wasmtime::component::__internal::Vec<i8>>1975where1976<S as wasmtime::AsContext>::Data: Send,1977{1978let callee = unsafe {1979wasmtime::component::TypedFunc::<1980(),1981(wasmtime::component::__internal::Vec<i8>,),1982>::new_unchecked(self.list_s8_ret)1983};1984let (ret0,) = callee1985.call_async(store.as_context_mut(), ())1986.await?;1987Ok(ret0)1988}1989pub async fn call_list_s16_ret<S: wasmtime::AsContextMut>(1990&self,1991mut store: S,1992) -> wasmtime::Result<wasmtime::component::__internal::Vec<i16>>1993where1994<S as wasmtime::AsContext>::Data: Send,1995{1996let callee = unsafe {1997wasmtime::component::TypedFunc::<1998(),1999(wasmtime::component::__internal::Vec<i16>,),2000>::new_unchecked(self.list_s16_ret)2001};2002let (ret0,) = callee2003.call_async(store.as_context_mut(), ())2004.await?;2005Ok(ret0)2006}2007pub async fn call_list_s32_ret<S: wasmtime::AsContextMut>(2008&self,2009mut store: S,2010) -> wasmtime::Result<wasmtime::component::__internal::Vec<i32>>2011where2012<S as wasmtime::AsContext>::Data: Send,2013{2014let callee = unsafe {2015wasmtime::component::TypedFunc::<2016(),2017(wasmtime::component::__internal::Vec<i32>,),2018>::new_unchecked(self.list_s32_ret)2019};2020let (ret0,) = callee2021.call_async(store.as_context_mut(), ())2022.await?;2023Ok(ret0)2024}2025pub async fn call_list_s64_ret<S: wasmtime::AsContextMut>(2026&self,2027mut store: S,2028) -> wasmtime::Result<wasmtime::component::__internal::Vec<i64>>2029where2030<S as wasmtime::AsContext>::Data: Send,2031{2032let callee = unsafe {2033wasmtime::component::TypedFunc::<2034(),2035(wasmtime::component::__internal::Vec<i64>,),2036>::new_unchecked(self.list_s64_ret)2037};2038let (ret0,) = callee2039.call_async(store.as_context_mut(), ())2040.await?;2041Ok(ret0)2042}2043pub async fn call_list_f32_ret<S: wasmtime::AsContextMut>(2044&self,2045mut store: S,2046) -> wasmtime::Result<wasmtime::component::__internal::Vec<f32>>2047where2048<S as wasmtime::AsContext>::Data: Send,2049{2050let callee = unsafe {2051wasmtime::component::TypedFunc::<2052(),2053(wasmtime::component::__internal::Vec<f32>,),2054>::new_unchecked(self.list_f32_ret)2055};2056let (ret0,) = callee2057.call_async(store.as_context_mut(), ())2058.await?;2059Ok(ret0)2060}2061pub async fn call_list_f64_ret<S: wasmtime::AsContextMut>(2062&self,2063mut store: S,2064) -> wasmtime::Result<wasmtime::component::__internal::Vec<f64>>2065where2066<S as wasmtime::AsContext>::Data: Send,2067{2068let callee = unsafe {2069wasmtime::component::TypedFunc::<2070(),2071(wasmtime::component::__internal::Vec<f64>,),2072>::new_unchecked(self.list_f64_ret)2073};2074let (ret0,) = callee2075.call_async(store.as_context_mut(), ())2076.await?;2077Ok(ret0)2078}2079pub async fn call_tuple_list<S: wasmtime::AsContextMut>(2080&self,2081mut store: S,2082arg0: &[(u8, i8)],2083) -> wasmtime::Result<2084wasmtime::component::__internal::Vec<(i64, u32)>,2085>2086where2087<S as wasmtime::AsContext>::Data: Send,2088{2089let callee = unsafe {2090wasmtime::component::TypedFunc::<2091(&[(u8, i8)],),2092(wasmtime::component::__internal::Vec<(i64, u32)>,),2093>::new_unchecked(self.tuple_list)2094};2095let (ret0,) = callee2096.call_async(store.as_context_mut(), (arg0,))2097.await?;2098Ok(ret0)2099}2100pub async fn call_string_list_arg<S: wasmtime::AsContextMut>(2101&self,2102mut store: S,2103arg0: &[wasmtime::component::__internal::String],2104) -> wasmtime::Result<()>2105where2106<S as wasmtime::AsContext>::Data: Send,2107{2108let callee = unsafe {2109wasmtime::component::TypedFunc::<2110(&[wasmtime::component::__internal::String],),2111(),2112>::new_unchecked(self.string_list_arg)2113};2114let () = callee2115.call_async(store.as_context_mut(), (arg0,))2116.await?;2117Ok(())2118}2119pub async fn call_string_list_ret<S: wasmtime::AsContextMut>(2120&self,2121mut store: S,2122) -> wasmtime::Result<2123wasmtime::component::__internal::Vec<2124wasmtime::component::__internal::String,2125>,2126>2127where2128<S as wasmtime::AsContext>::Data: Send,2129{2130let callee = unsafe {2131wasmtime::component::TypedFunc::<2132(),2133(2134wasmtime::component::__internal::Vec<2135wasmtime::component::__internal::String,2136>,2137),2138>::new_unchecked(self.string_list_ret)2139};2140let (ret0,) = callee2141.call_async(store.as_context_mut(), ())2142.await?;2143Ok(ret0)2144}2145pub async fn call_tuple_string_list<S: wasmtime::AsContextMut>(2146&self,2147mut store: S,2148arg0: &[(u8, wasmtime::component::__internal::String)],2149) -> wasmtime::Result<2150wasmtime::component::__internal::Vec<2151(wasmtime::component::__internal::String, u8),2152>,2153>2154where2155<S as wasmtime::AsContext>::Data: Send,2156{2157let callee = unsafe {2158wasmtime::component::TypedFunc::<2159(&[(u8, wasmtime::component::__internal::String)],),2160(2161wasmtime::component::__internal::Vec<2162(wasmtime::component::__internal::String, u8),2163>,2164),2165>::new_unchecked(self.tuple_string_list)2166};2167let (ret0,) = callee2168.call_async(store.as_context_mut(), (arg0,))2169.await?;2170Ok(ret0)2171}2172pub async fn call_string_list<S: wasmtime::AsContextMut>(2173&self,2174mut store: S,2175arg0: &[wasmtime::component::__internal::String],2176) -> wasmtime::Result<2177wasmtime::component::__internal::Vec<2178wasmtime::component::__internal::String,2179>,2180>2181where2182<S as wasmtime::AsContext>::Data: Send,2183{2184let callee = unsafe {2185wasmtime::component::TypedFunc::<2186(&[wasmtime::component::__internal::String],),2187(2188wasmtime::component::__internal::Vec<2189wasmtime::component::__internal::String,2190>,2191),2192>::new_unchecked(self.string_list)2193};2194let (ret0,) = callee2195.call_async(store.as_context_mut(), (arg0,))2196.await?;2197Ok(ret0)2198}2199pub async fn call_record_list<S: wasmtime::AsContextMut>(2200&self,2201mut store: S,2202arg0: &[SomeRecord],2203) -> wasmtime::Result<2204wasmtime::component::__internal::Vec<OtherRecord>,2205>2206where2207<S as wasmtime::AsContext>::Data: Send,2208{2209let callee = unsafe {2210wasmtime::component::TypedFunc::<2211(&[SomeRecord],),2212(wasmtime::component::__internal::Vec<OtherRecord>,),2213>::new_unchecked(self.record_list)2214};2215let (ret0,) = callee2216.call_async(store.as_context_mut(), (arg0,))2217.await?;2218Ok(ret0)2219}2220pub async fn call_record_list_reverse<S: wasmtime::AsContextMut>(2221&self,2222mut store: S,2223arg0: &[OtherRecord],2224) -> wasmtime::Result<2225wasmtime::component::__internal::Vec<SomeRecord>,2226>2227where2228<S as wasmtime::AsContext>::Data: Send,2229{2230let callee = unsafe {2231wasmtime::component::TypedFunc::<2232(&[OtherRecord],),2233(wasmtime::component::__internal::Vec<SomeRecord>,),2234>::new_unchecked(self.record_list_reverse)2235};2236let (ret0,) = callee2237.call_async(store.as_context_mut(), (arg0,))2238.await?;2239Ok(ret0)2240}2241pub async fn call_variant_list<S: wasmtime::AsContextMut>(2242&self,2243mut store: S,2244arg0: &[SomeVariant],2245) -> wasmtime::Result<2246wasmtime::component::__internal::Vec<OtherVariant>,2247>2248where2249<S as wasmtime::AsContext>::Data: Send,2250{2251let callee = unsafe {2252wasmtime::component::TypedFunc::<2253(&[SomeVariant],),2254(wasmtime::component::__internal::Vec<OtherVariant>,),2255>::new_unchecked(self.variant_list)2256};2257let (ret0,) = callee2258.call_async(store.as_context_mut(), (arg0,))2259.await?;2260Ok(ret0)2261}2262pub async fn call_load_store_everything<S: wasmtime::AsContextMut>(2263&self,2264mut store: S,2265arg0: &LoadStoreAllSizes,2266) -> wasmtime::Result<LoadStoreAllSizes>2267where2268<S as wasmtime::AsContext>::Data: Send,2269{2270let callee = unsafe {2271wasmtime::component::TypedFunc::<2272(&LoadStoreAllSizes,),2273(LoadStoreAllSizes,),2274>::new_unchecked(self.load_store_everything)2275};2276let (ret0,) = callee2277.call_async(store.as_context_mut(), (arg0,))2278.await?;2279Ok(ret0)2280}2281}2282}2283}2284}2285}228622872288