Path: blob/main/crates/component-macro/tests/expanded/lists_async.rs
1692 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 _: () = {105#[allow(unused_imports)]106use wasmtime::component::__internal::anyhow;107impl TheListsIndices {108/// Creates a new copy of `TheListsIndices` bindings which can then109/// be used to instantiate into a particular store.110///111/// This method may fail if the component does not have the112/// required exports.113pub fn new<_T>(114_instance_pre: &wasmtime::component::InstancePre<_T>,115) -> wasmtime::Result<Self> {116let _component = _instance_pre.component();117let _instance_type = _instance_pre.instance_type();118let interface0 = exports::foo::foo::lists::GuestIndices::new(_instance_pre)?;119Ok(TheListsIndices { interface0 })120}121/// Uses the indices stored in `self` to load an instance122/// of [`TheLists`] from the instance provided.123///124/// Note that at this time this method will additionally125/// perform type-checks of all exports.126pub fn load(127&self,128mut store: impl wasmtime::AsContextMut,129instance: &wasmtime::component::Instance,130) -> wasmtime::Result<TheLists> {131let _ = &mut store;132let _instance = instance;133let interface0 = self.interface0.load(&mut store, &_instance)?;134Ok(TheLists { interface0 })135}136}137impl TheLists {138/// Convenience wrapper around [`TheListsPre::new`] and139/// [`TheListsPre::instantiate`].140pub fn instantiate<_T>(141store: impl wasmtime::AsContextMut<Data = _T>,142component: &wasmtime::component::Component,143linker: &wasmtime::component::Linker<_T>,144) -> wasmtime::Result<TheLists> {145let pre = linker.instantiate_pre(component)?;146TheListsPre::new(pre)?.instantiate(store)147}148/// Convenience wrapper around [`TheListsIndices::new`] and149/// [`TheListsIndices::load`].150pub fn new(151mut store: impl wasmtime::AsContextMut,152instance: &wasmtime::component::Instance,153) -> wasmtime::Result<TheLists> {154let indices = TheListsIndices::new(&instance.instance_pre(&store))?;155indices.load(&mut store, instance)156}157/// Convenience wrapper around [`TheListsPre::new`] and158/// [`TheListsPre::instantiate_async`].159pub async fn instantiate_async<_T>(160store: impl wasmtime::AsContextMut<Data = _T>,161component: &wasmtime::component::Component,162linker: &wasmtime::component::Linker<_T>,163) -> wasmtime::Result<TheLists>164where165_T: Send,166{167let pre = linker.instantiate_pre(component)?;168TheListsPre::new(pre)?.instantiate_async(store).await169}170pub fn add_to_linker<T, D>(171linker: &mut wasmtime::component::Linker<T>,172host_getter: fn(&mut T) -> D::Data<'_>,173) -> wasmtime::Result<()>174where175D: foo::foo::lists::HostWithStore + Send,176for<'a> D::Data<'a>: foo::foo::lists::Host + Send,177T: 'static + Send,178{179foo::foo::lists::add_to_linker::<T, D>(linker, host_getter)?;180Ok(())181}182pub fn foo_foo_lists(&self) -> &exports::foo::foo::lists::Guest {183&self.interface0184}185}186};187pub mod foo {188pub mod foo {189#[allow(clippy::all)]190pub mod lists {191#[allow(unused_imports)]192use wasmtime::component::__internal::{anyhow, Box};193#[derive(wasmtime::component::ComponentType)]194#[derive(wasmtime::component::Lift)]195#[derive(wasmtime::component::Lower)]196#[component(record)]197#[derive(Clone)]198pub struct OtherRecord {199#[component(name = "a1")]200pub a1: u32,201#[component(name = "a2")]202pub a2: u64,203#[component(name = "a3")]204pub a3: i32,205#[component(name = "a4")]206pub a4: i64,207#[component(name = "b")]208pub b: wasmtime::component::__internal::String,209#[component(name = "c")]210pub c: wasmtime::component::__internal::Vec<u8>,211}212impl core::fmt::Debug for OtherRecord {213fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {214f.debug_struct("OtherRecord")215.field("a1", &self.a1)216.field("a2", &self.a2)217.field("a3", &self.a3)218.field("a4", &self.a4)219.field("b", &self.b)220.field("c", &self.c)221.finish()222}223}224const _: () = {225assert!(22648 == < OtherRecord as wasmtime::component::ComponentType >::SIZE32227);228assert!(2298 == < OtherRecord as wasmtime::component::ComponentType >::ALIGN32230);231};232#[derive(wasmtime::component::ComponentType)]233#[derive(wasmtime::component::Lift)]234#[derive(wasmtime::component::Lower)]235#[component(record)]236#[derive(Clone)]237pub struct SomeRecord {238#[component(name = "x")]239pub x: wasmtime::component::__internal::String,240#[component(name = "y")]241pub y: OtherRecord,242#[component(name = "z")]243pub z: wasmtime::component::__internal::Vec<OtherRecord>,244#[component(name = "c1")]245pub c1: u32,246#[component(name = "c2")]247pub c2: u64,248#[component(name = "c3")]249pub c3: i32,250#[component(name = "c4")]251pub c4: i64,252}253impl core::fmt::Debug for SomeRecord {254fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {255f.debug_struct("SomeRecord")256.field("x", &self.x)257.field("y", &self.y)258.field("z", &self.z)259.field("c1", &self.c1)260.field("c2", &self.c2)261.field("c3", &self.c3)262.field("c4", &self.c4)263.finish()264}265}266const _: () = {267assert!(26896 == < SomeRecord as wasmtime::component::ComponentType >::SIZE32269);270assert!(2718 == < SomeRecord as wasmtime::component::ComponentType >::ALIGN32272);273};274#[derive(wasmtime::component::ComponentType)]275#[derive(wasmtime::component::Lift)]276#[derive(wasmtime::component::Lower)]277#[component(variant)]278#[derive(Clone)]279pub enum OtherVariant {280#[component(name = "a")]281A,282#[component(name = "b")]283B(u32),284#[component(name = "c")]285C(wasmtime::component::__internal::String),286}287impl core::fmt::Debug for OtherVariant {288fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {289match self {290OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),291OtherVariant::B(e) => {292f.debug_tuple("OtherVariant::B").field(e).finish()293}294OtherVariant::C(e) => {295f.debug_tuple("OtherVariant::C").field(e).finish()296}297}298}299}300const _: () = {301assert!(30212 == < OtherVariant as wasmtime::component::ComponentType >::SIZE32303);304assert!(3054 == < OtherVariant as wasmtime::component::ComponentType >::ALIGN32306);307};308#[derive(wasmtime::component::ComponentType)]309#[derive(wasmtime::component::Lift)]310#[derive(wasmtime::component::Lower)]311#[component(variant)]312#[derive(Clone)]313pub enum SomeVariant {314#[component(name = "a")]315A(wasmtime::component::__internal::String),316#[component(name = "b")]317B,318#[component(name = "c")]319C(u32),320#[component(name = "d")]321D(wasmtime::component::__internal::Vec<OtherVariant>),322}323impl core::fmt::Debug for SomeVariant {324fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {325match self {326SomeVariant::A(e) => {327f.debug_tuple("SomeVariant::A").field(e).finish()328}329SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),330SomeVariant::C(e) => {331f.debug_tuple("SomeVariant::C").field(e).finish()332}333SomeVariant::D(e) => {334f.debug_tuple("SomeVariant::D").field(e).finish()335}336}337}338}339const _: () = {340assert!(34112 == < SomeVariant as wasmtime::component::ComponentType >::SIZE32342);343assert!(3444 == < SomeVariant as wasmtime::component::ComponentType >::ALIGN32345);346};347pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<348(349wasmtime::component::__internal::String,350u8,351i8,352u16,353i16,354u32,355i32,356u64,357i64,358f32,359f64,360char,361),362>;363const _: () = {364assert!(3658 == < LoadStoreAllSizes as wasmtime::component::ComponentType366>::SIZE32367);368assert!(3694 == < LoadStoreAllSizes as wasmtime::component::ComponentType370>::ALIGN32371);372};373pub trait HostWithStore: wasmtime::component::HasData + Send {}374impl<_T: ?Sized> HostWithStore for _T375where376_T: wasmtime::component::HasData + Send,377{}378pub trait Host: Send {379fn list_u8_param(380&mut self,381x: wasmtime::component::__internal::Vec<u8>,382) -> impl ::core::future::Future<Output = ()> + Send;383fn list_u16_param(384&mut self,385x: wasmtime::component::__internal::Vec<u16>,386) -> impl ::core::future::Future<Output = ()> + Send;387fn list_u32_param(388&mut self,389x: wasmtime::component::__internal::Vec<u32>,390) -> impl ::core::future::Future<Output = ()> + Send;391fn list_u64_param(392&mut self,393x: wasmtime::component::__internal::Vec<u64>,394) -> impl ::core::future::Future<Output = ()> + Send;395fn list_s8_param(396&mut self,397x: wasmtime::component::__internal::Vec<i8>,398) -> impl ::core::future::Future<Output = ()> + Send;399fn list_s16_param(400&mut self,401x: wasmtime::component::__internal::Vec<i16>,402) -> impl ::core::future::Future<Output = ()> + Send;403fn list_s32_param(404&mut self,405x: wasmtime::component::__internal::Vec<i32>,406) -> impl ::core::future::Future<Output = ()> + Send;407fn list_s64_param(408&mut self,409x: wasmtime::component::__internal::Vec<i64>,410) -> impl ::core::future::Future<Output = ()> + Send;411fn list_f32_param(412&mut self,413x: wasmtime::component::__internal::Vec<f32>,414) -> impl ::core::future::Future<Output = ()> + Send;415fn list_f64_param(416&mut self,417x: wasmtime::component::__internal::Vec<f64>,418) -> impl ::core::future::Future<Output = ()> + Send;419fn list_u8_ret(420&mut self,421) -> impl ::core::future::Future<422Output = wasmtime::component::__internal::Vec<u8>,423> + Send;424fn list_u16_ret(425&mut self,426) -> impl ::core::future::Future<427Output = wasmtime::component::__internal::Vec<u16>,428> + Send;429fn list_u32_ret(430&mut self,431) -> impl ::core::future::Future<432Output = wasmtime::component::__internal::Vec<u32>,433> + Send;434fn list_u64_ret(435&mut self,436) -> impl ::core::future::Future<437Output = wasmtime::component::__internal::Vec<u64>,438> + Send;439fn list_s8_ret(440&mut self,441) -> impl ::core::future::Future<442Output = wasmtime::component::__internal::Vec<i8>,443> + Send;444fn list_s16_ret(445&mut self,446) -> impl ::core::future::Future<447Output = wasmtime::component::__internal::Vec<i16>,448> + Send;449fn list_s32_ret(450&mut self,451) -> impl ::core::future::Future<452Output = wasmtime::component::__internal::Vec<i32>,453> + Send;454fn list_s64_ret(455&mut self,456) -> impl ::core::future::Future<457Output = wasmtime::component::__internal::Vec<i64>,458> + Send;459fn list_f32_ret(460&mut self,461) -> impl ::core::future::Future<462Output = wasmtime::component::__internal::Vec<f32>,463> + Send;464fn list_f64_ret(465&mut self,466) -> impl ::core::future::Future<467Output = wasmtime::component::__internal::Vec<f64>,468> + Send;469fn tuple_list(470&mut self,471x: wasmtime::component::__internal::Vec<(u8, i8)>,472) -> impl ::core::future::Future<473Output = wasmtime::component::__internal::Vec<(i64, u32)>,474> + Send;475fn string_list_arg(476&mut self,477a: wasmtime::component::__internal::Vec<478wasmtime::component::__internal::String,479>,480) -> impl ::core::future::Future<Output = ()> + Send;481fn string_list_ret(482&mut self,483) -> impl ::core::future::Future<484Output = wasmtime::component::__internal::Vec<485wasmtime::component::__internal::String,486>,487> + Send;488fn tuple_string_list(489&mut self,490x: wasmtime::component::__internal::Vec<491(u8, wasmtime::component::__internal::String),492>,493) -> impl ::core::future::Future<494Output = wasmtime::component::__internal::Vec<495(wasmtime::component::__internal::String, u8),496>,497> + Send;498fn string_list(499&mut self,500x: wasmtime::component::__internal::Vec<501wasmtime::component::__internal::String,502>,503) -> impl ::core::future::Future<504Output = wasmtime::component::__internal::Vec<505wasmtime::component::__internal::String,506>,507> + Send;508fn record_list(509&mut self,510x: wasmtime::component::__internal::Vec<SomeRecord>,511) -> impl ::core::future::Future<512Output = wasmtime::component::__internal::Vec<OtherRecord>,513> + Send;514fn record_list_reverse(515&mut self,516x: wasmtime::component::__internal::Vec<OtherRecord>,517) -> impl ::core::future::Future<518Output = wasmtime::component::__internal::Vec<SomeRecord>,519> + Send;520fn variant_list(521&mut self,522x: wasmtime::component::__internal::Vec<SomeVariant>,523) -> impl ::core::future::Future<524Output = wasmtime::component::__internal::Vec<OtherVariant>,525> + Send;526fn load_store_everything(527&mut self,528a: LoadStoreAllSizes,529) -> impl ::core::future::Future<Output = LoadStoreAllSizes> + Send;530}531impl<_T: Host + ?Sized + Send> Host for &mut _T {532fn list_u8_param(533&mut self,534x: wasmtime::component::__internal::Vec<u8>,535) -> impl ::core::future::Future<Output = ()> + Send {536async move { Host::list_u8_param(*self, x).await }537}538fn list_u16_param(539&mut self,540x: wasmtime::component::__internal::Vec<u16>,541) -> impl ::core::future::Future<Output = ()> + Send {542async move { Host::list_u16_param(*self, x).await }543}544fn list_u32_param(545&mut self,546x: wasmtime::component::__internal::Vec<u32>,547) -> impl ::core::future::Future<Output = ()> + Send {548async move { Host::list_u32_param(*self, x).await }549}550fn list_u64_param(551&mut self,552x: wasmtime::component::__internal::Vec<u64>,553) -> impl ::core::future::Future<Output = ()> + Send {554async move { Host::list_u64_param(*self, x).await }555}556fn list_s8_param(557&mut self,558x: wasmtime::component::__internal::Vec<i8>,559) -> impl ::core::future::Future<Output = ()> + Send {560async move { Host::list_s8_param(*self, x).await }561}562fn list_s16_param(563&mut self,564x: wasmtime::component::__internal::Vec<i16>,565) -> impl ::core::future::Future<Output = ()> + Send {566async move { Host::list_s16_param(*self, x).await }567}568fn list_s32_param(569&mut self,570x: wasmtime::component::__internal::Vec<i32>,571) -> impl ::core::future::Future<Output = ()> + Send {572async move { Host::list_s32_param(*self, x).await }573}574fn list_s64_param(575&mut self,576x: wasmtime::component::__internal::Vec<i64>,577) -> impl ::core::future::Future<Output = ()> + Send {578async move { Host::list_s64_param(*self, x).await }579}580fn list_f32_param(581&mut self,582x: wasmtime::component::__internal::Vec<f32>,583) -> impl ::core::future::Future<Output = ()> + Send {584async move { Host::list_f32_param(*self, x).await }585}586fn list_f64_param(587&mut self,588x: wasmtime::component::__internal::Vec<f64>,589) -> impl ::core::future::Future<Output = ()> + Send {590async move { Host::list_f64_param(*self, x).await }591}592fn list_u8_ret(593&mut self,594) -> impl ::core::future::Future<595Output = wasmtime::component::__internal::Vec<u8>,596> + Send {597async move { Host::list_u8_ret(*self).await }598}599fn list_u16_ret(600&mut self,601) -> impl ::core::future::Future<602Output = wasmtime::component::__internal::Vec<u16>,603> + Send {604async move { Host::list_u16_ret(*self).await }605}606fn list_u32_ret(607&mut self,608) -> impl ::core::future::Future<609Output = wasmtime::component::__internal::Vec<u32>,610> + Send {611async move { Host::list_u32_ret(*self).await }612}613fn list_u64_ret(614&mut self,615) -> impl ::core::future::Future<616Output = wasmtime::component::__internal::Vec<u64>,617> + Send {618async move { Host::list_u64_ret(*self).await }619}620fn list_s8_ret(621&mut self,622) -> impl ::core::future::Future<623Output = wasmtime::component::__internal::Vec<i8>,624> + Send {625async move { Host::list_s8_ret(*self).await }626}627fn list_s16_ret(628&mut self,629) -> impl ::core::future::Future<630Output = wasmtime::component::__internal::Vec<i16>,631> + Send {632async move { Host::list_s16_ret(*self).await }633}634fn list_s32_ret(635&mut self,636) -> impl ::core::future::Future<637Output = wasmtime::component::__internal::Vec<i32>,638> + Send {639async move { Host::list_s32_ret(*self).await }640}641fn list_s64_ret(642&mut self,643) -> impl ::core::future::Future<644Output = wasmtime::component::__internal::Vec<i64>,645> + Send {646async move { Host::list_s64_ret(*self).await }647}648fn list_f32_ret(649&mut self,650) -> impl ::core::future::Future<651Output = wasmtime::component::__internal::Vec<f32>,652> + Send {653async move { Host::list_f32_ret(*self).await }654}655fn list_f64_ret(656&mut self,657) -> impl ::core::future::Future<658Output = wasmtime::component::__internal::Vec<f64>,659> + Send {660async move { Host::list_f64_ret(*self).await }661}662fn tuple_list(663&mut self,664x: wasmtime::component::__internal::Vec<(u8, i8)>,665) -> impl ::core::future::Future<666Output = wasmtime::component::__internal::Vec<(i64, u32)>,667> + Send {668async move { Host::tuple_list(*self, x).await }669}670fn string_list_arg(671&mut self,672a: wasmtime::component::__internal::Vec<673wasmtime::component::__internal::String,674>,675) -> impl ::core::future::Future<Output = ()> + Send {676async move { Host::string_list_arg(*self, a).await }677}678fn string_list_ret(679&mut self,680) -> impl ::core::future::Future<681Output = wasmtime::component::__internal::Vec<682wasmtime::component::__internal::String,683>,684> + Send {685async move { Host::string_list_ret(*self).await }686}687fn tuple_string_list(688&mut self,689x: wasmtime::component::__internal::Vec<690(u8, wasmtime::component::__internal::String),691>,692) -> impl ::core::future::Future<693Output = wasmtime::component::__internal::Vec<694(wasmtime::component::__internal::String, u8),695>,696> + Send {697async move { Host::tuple_string_list(*self, x).await }698}699fn string_list(700&mut self,701x: wasmtime::component::__internal::Vec<702wasmtime::component::__internal::String,703>,704) -> impl ::core::future::Future<705Output = wasmtime::component::__internal::Vec<706wasmtime::component::__internal::String,707>,708> + Send {709async move { Host::string_list(*self, x).await }710}711fn record_list(712&mut self,713x: wasmtime::component::__internal::Vec<SomeRecord>,714) -> impl ::core::future::Future<715Output = wasmtime::component::__internal::Vec<OtherRecord>,716> + Send {717async move { Host::record_list(*self, x).await }718}719fn record_list_reverse(720&mut self,721x: wasmtime::component::__internal::Vec<OtherRecord>,722) -> impl ::core::future::Future<723Output = wasmtime::component::__internal::Vec<SomeRecord>,724> + Send {725async move { Host::record_list_reverse(*self, x).await }726}727fn variant_list(728&mut self,729x: wasmtime::component::__internal::Vec<SomeVariant>,730) -> impl ::core::future::Future<731Output = wasmtime::component::__internal::Vec<OtherVariant>,732> + Send {733async move { Host::variant_list(*self, x).await }734}735fn load_store_everything(736&mut self,737a: LoadStoreAllSizes,738) -> impl ::core::future::Future<Output = LoadStoreAllSizes> + Send {739async move { Host::load_store_everything(*self, a).await }740}741}742pub fn add_to_linker<T, D>(743linker: &mut wasmtime::component::Linker<T>,744host_getter: fn(&mut T) -> D::Data<'_>,745) -> wasmtime::Result<()>746where747D: HostWithStore,748for<'a> D::Data<'a>: Host,749T: 'static + Send,750{751let mut inst = linker.instance("foo:foo/lists")?;752inst.func_wrap_async(753"list-u8-param",754move |755mut caller: wasmtime::StoreContextMut<'_, T>,756(arg0,): (wasmtime::component::__internal::Vec<u8>,)|757{758wasmtime::component::__internal::Box::new(async move {759let host = &mut host_getter(caller.data_mut());760let r = Host::list_u8_param(host, arg0).await;761Ok(r)762})763},764)?;765inst.func_wrap_async(766"list-u16-param",767move |768mut caller: wasmtime::StoreContextMut<'_, T>,769(arg0,): (wasmtime::component::__internal::Vec<u16>,)|770{771wasmtime::component::__internal::Box::new(async move {772let host = &mut host_getter(caller.data_mut());773let r = Host::list_u16_param(host, arg0).await;774Ok(r)775})776},777)?;778inst.func_wrap_async(779"list-u32-param",780move |781mut caller: wasmtime::StoreContextMut<'_, T>,782(arg0,): (wasmtime::component::__internal::Vec<u32>,)|783{784wasmtime::component::__internal::Box::new(async move {785let host = &mut host_getter(caller.data_mut());786let r = Host::list_u32_param(host, arg0).await;787Ok(r)788})789},790)?;791inst.func_wrap_async(792"list-u64-param",793move |794mut caller: wasmtime::StoreContextMut<'_, T>,795(arg0,): (wasmtime::component::__internal::Vec<u64>,)|796{797wasmtime::component::__internal::Box::new(async move {798let host = &mut host_getter(caller.data_mut());799let r = Host::list_u64_param(host, arg0).await;800Ok(r)801})802},803)?;804inst.func_wrap_async(805"list-s8-param",806move |807mut caller: wasmtime::StoreContextMut<'_, T>,808(arg0,): (wasmtime::component::__internal::Vec<i8>,)|809{810wasmtime::component::__internal::Box::new(async move {811let host = &mut host_getter(caller.data_mut());812let r = Host::list_s8_param(host, arg0).await;813Ok(r)814})815},816)?;817inst.func_wrap_async(818"list-s16-param",819move |820mut caller: wasmtime::StoreContextMut<'_, T>,821(arg0,): (wasmtime::component::__internal::Vec<i16>,)|822{823wasmtime::component::__internal::Box::new(async move {824let host = &mut host_getter(caller.data_mut());825let r = Host::list_s16_param(host, arg0).await;826Ok(r)827})828},829)?;830inst.func_wrap_async(831"list-s32-param",832move |833mut caller: wasmtime::StoreContextMut<'_, T>,834(arg0,): (wasmtime::component::__internal::Vec<i32>,)|835{836wasmtime::component::__internal::Box::new(async move {837let host = &mut host_getter(caller.data_mut());838let r = Host::list_s32_param(host, arg0).await;839Ok(r)840})841},842)?;843inst.func_wrap_async(844"list-s64-param",845move |846mut caller: wasmtime::StoreContextMut<'_, T>,847(arg0,): (wasmtime::component::__internal::Vec<i64>,)|848{849wasmtime::component::__internal::Box::new(async move {850let host = &mut host_getter(caller.data_mut());851let r = Host::list_s64_param(host, arg0).await;852Ok(r)853})854},855)?;856inst.func_wrap_async(857"list-f32-param",858move |859mut caller: wasmtime::StoreContextMut<'_, T>,860(arg0,): (wasmtime::component::__internal::Vec<f32>,)|861{862wasmtime::component::__internal::Box::new(async move {863let host = &mut host_getter(caller.data_mut());864let r = Host::list_f32_param(host, arg0).await;865Ok(r)866})867},868)?;869inst.func_wrap_async(870"list-f64-param",871move |872mut caller: wasmtime::StoreContextMut<'_, T>,873(arg0,): (wasmtime::component::__internal::Vec<f64>,)|874{875wasmtime::component::__internal::Box::new(async move {876let host = &mut host_getter(caller.data_mut());877let r = Host::list_f64_param(host, arg0).await;878Ok(r)879})880},881)?;882inst.func_wrap_async(883"list-u8-ret",884move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {885wasmtime::component::__internal::Box::new(async move {886let host = &mut host_getter(caller.data_mut());887let r = Host::list_u8_ret(host).await;888Ok((r,))889})890},891)?;892inst.func_wrap_async(893"list-u16-ret",894move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {895wasmtime::component::__internal::Box::new(async move {896let host = &mut host_getter(caller.data_mut());897let r = Host::list_u16_ret(host).await;898Ok((r,))899})900},901)?;902inst.func_wrap_async(903"list-u32-ret",904move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {905wasmtime::component::__internal::Box::new(async move {906let host = &mut host_getter(caller.data_mut());907let r = Host::list_u32_ret(host).await;908Ok((r,))909})910},911)?;912inst.func_wrap_async(913"list-u64-ret",914move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {915wasmtime::component::__internal::Box::new(async move {916let host = &mut host_getter(caller.data_mut());917let r = Host::list_u64_ret(host).await;918Ok((r,))919})920},921)?;922inst.func_wrap_async(923"list-s8-ret",924move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {925wasmtime::component::__internal::Box::new(async move {926let host = &mut host_getter(caller.data_mut());927let r = Host::list_s8_ret(host).await;928Ok((r,))929})930},931)?;932inst.func_wrap_async(933"list-s16-ret",934move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {935wasmtime::component::__internal::Box::new(async move {936let host = &mut host_getter(caller.data_mut());937let r = Host::list_s16_ret(host).await;938Ok((r,))939})940},941)?;942inst.func_wrap_async(943"list-s32-ret",944move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {945wasmtime::component::__internal::Box::new(async move {946let host = &mut host_getter(caller.data_mut());947let r = Host::list_s32_ret(host).await;948Ok((r,))949})950},951)?;952inst.func_wrap_async(953"list-s64-ret",954move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {955wasmtime::component::__internal::Box::new(async move {956let host = &mut host_getter(caller.data_mut());957let r = Host::list_s64_ret(host).await;958Ok((r,))959})960},961)?;962inst.func_wrap_async(963"list-f32-ret",964move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {965wasmtime::component::__internal::Box::new(async move {966let host = &mut host_getter(caller.data_mut());967let r = Host::list_f32_ret(host).await;968Ok((r,))969})970},971)?;972inst.func_wrap_async(973"list-f64-ret",974move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {975wasmtime::component::__internal::Box::new(async move {976let host = &mut host_getter(caller.data_mut());977let r = Host::list_f64_ret(host).await;978Ok((r,))979})980},981)?;982inst.func_wrap_async(983"tuple-list",984move |985mut caller: wasmtime::StoreContextMut<'_, T>,986(arg0,): (wasmtime::component::__internal::Vec<(u8, i8)>,)|987{988wasmtime::component::__internal::Box::new(async move {989let host = &mut host_getter(caller.data_mut());990let r = Host::tuple_list(host, arg0).await;991Ok((r,))992})993},994)?;995inst.func_wrap_async(996"string-list-arg",997move |998mut caller: wasmtime::StoreContextMut<'_, T>,999(1000arg0,1001): (1002wasmtime::component::__internal::Vec<1003wasmtime::component::__internal::String,1004>,1005)|1006{1007wasmtime::component::__internal::Box::new(async move {1008let host = &mut host_getter(caller.data_mut());1009let r = Host::string_list_arg(host, arg0).await;1010Ok(r)1011})1012},1013)?;1014inst.func_wrap_async(1015"string-list-ret",1016move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1017wasmtime::component::__internal::Box::new(async move {1018let host = &mut host_getter(caller.data_mut());1019let r = Host::string_list_ret(host).await;1020Ok((r,))1021})1022},1023)?;1024inst.func_wrap_async(1025"tuple-string-list",1026move |1027mut caller: wasmtime::StoreContextMut<'_, T>,1028(1029arg0,1030): (1031wasmtime::component::__internal::Vec<1032(u8, wasmtime::component::__internal::String),1033>,1034)|1035{1036wasmtime::component::__internal::Box::new(async move {1037let host = &mut host_getter(caller.data_mut());1038let r = Host::tuple_string_list(host, arg0).await;1039Ok((r,))1040})1041},1042)?;1043inst.func_wrap_async(1044"string-list",1045move |1046mut caller: wasmtime::StoreContextMut<'_, T>,1047(1048arg0,1049): (1050wasmtime::component::__internal::Vec<1051wasmtime::component::__internal::String,1052>,1053)|1054{1055wasmtime::component::__internal::Box::new(async move {1056let host = &mut host_getter(caller.data_mut());1057let r = Host::string_list(host, arg0).await;1058Ok((r,))1059})1060},1061)?;1062inst.func_wrap_async(1063"record-list",1064move |1065mut caller: wasmtime::StoreContextMut<'_, T>,1066(arg0,): (wasmtime::component::__internal::Vec<SomeRecord>,)|1067{1068wasmtime::component::__internal::Box::new(async move {1069let host = &mut host_getter(caller.data_mut());1070let r = Host::record_list(host, arg0).await;1071Ok((r,))1072})1073},1074)?;1075inst.func_wrap_async(1076"record-list-reverse",1077move |1078mut caller: wasmtime::StoreContextMut<'_, T>,1079(arg0,): (wasmtime::component::__internal::Vec<OtherRecord>,)|1080{1081wasmtime::component::__internal::Box::new(async move {1082let host = &mut host_getter(caller.data_mut());1083let r = Host::record_list_reverse(host, arg0).await;1084Ok((r,))1085})1086},1087)?;1088inst.func_wrap_async(1089"variant-list",1090move |1091mut caller: wasmtime::StoreContextMut<'_, T>,1092(arg0,): (wasmtime::component::__internal::Vec<SomeVariant>,)|1093{1094wasmtime::component::__internal::Box::new(async move {1095let host = &mut host_getter(caller.data_mut());1096let r = Host::variant_list(host, arg0).await;1097Ok((r,))1098})1099},1100)?;1101inst.func_wrap_async(1102"load-store-everything",1103move |1104mut caller: wasmtime::StoreContextMut<'_, T>,1105(arg0,): (LoadStoreAllSizes,)|1106{1107wasmtime::component::__internal::Box::new(async move {1108let host = &mut host_getter(caller.data_mut());1109let r = Host::load_store_everything(host, arg0).await;1110Ok((r,))1111})1112},1113)?;1114Ok(())1115}1116}1117}1118}1119pub mod exports {1120pub mod foo {1121pub mod foo {1122#[allow(clippy::all)]1123pub mod lists {1124#[allow(unused_imports)]1125use wasmtime::component::__internal::{anyhow, Box};1126#[derive(wasmtime::component::ComponentType)]1127#[derive(wasmtime::component::Lift)]1128#[derive(wasmtime::component::Lower)]1129#[component(record)]1130#[derive(Clone)]1131pub struct OtherRecord {1132#[component(name = "a1")]1133pub a1: u32,1134#[component(name = "a2")]1135pub a2: u64,1136#[component(name = "a3")]1137pub a3: i32,1138#[component(name = "a4")]1139pub a4: i64,1140#[component(name = "b")]1141pub b: wasmtime::component::__internal::String,1142#[component(name = "c")]1143pub c: wasmtime::component::__internal::Vec<u8>,1144}1145impl core::fmt::Debug for OtherRecord {1146fn fmt(1147&self,1148f: &mut core::fmt::Formatter<'_>,1149) -> core::fmt::Result {1150f.debug_struct("OtherRecord")1151.field("a1", &self.a1)1152.field("a2", &self.a2)1153.field("a3", &self.a3)1154.field("a4", &self.a4)1155.field("b", &self.b)1156.field("c", &self.c)1157.finish()1158}1159}1160const _: () = {1161assert!(116248 == < OtherRecord as wasmtime::component::ComponentType1163>::SIZE321164);1165assert!(11668 == < OtherRecord as wasmtime::component::ComponentType1167>::ALIGN321168);1169};1170#[derive(wasmtime::component::ComponentType)]1171#[derive(wasmtime::component::Lift)]1172#[derive(wasmtime::component::Lower)]1173#[component(record)]1174#[derive(Clone)]1175pub struct SomeRecord {1176#[component(name = "x")]1177pub x: wasmtime::component::__internal::String,1178#[component(name = "y")]1179pub y: OtherRecord,1180#[component(name = "z")]1181pub z: wasmtime::component::__internal::Vec<OtherRecord>,1182#[component(name = "c1")]1183pub c1: u32,1184#[component(name = "c2")]1185pub c2: u64,1186#[component(name = "c3")]1187pub c3: i32,1188#[component(name = "c4")]1189pub c4: i64,1190}1191impl core::fmt::Debug for SomeRecord {1192fn fmt(1193&self,1194f: &mut core::fmt::Formatter<'_>,1195) -> core::fmt::Result {1196f.debug_struct("SomeRecord")1197.field("x", &self.x)1198.field("y", &self.y)1199.field("z", &self.z)1200.field("c1", &self.c1)1201.field("c2", &self.c2)1202.field("c3", &self.c3)1203.field("c4", &self.c4)1204.finish()1205}1206}1207const _: () = {1208assert!(120996 == < SomeRecord as wasmtime::component::ComponentType1210>::SIZE321211);1212assert!(12138 == < SomeRecord as wasmtime::component::ComponentType1214>::ALIGN321215);1216};1217#[derive(wasmtime::component::ComponentType)]1218#[derive(wasmtime::component::Lift)]1219#[derive(wasmtime::component::Lower)]1220#[component(variant)]1221#[derive(Clone)]1222pub enum OtherVariant {1223#[component(name = "a")]1224A,1225#[component(name = "b")]1226B(u32),1227#[component(name = "c")]1228C(wasmtime::component::__internal::String),1229}1230impl core::fmt::Debug for OtherVariant {1231fn fmt(1232&self,1233f: &mut core::fmt::Formatter<'_>,1234) -> core::fmt::Result {1235match self {1236OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),1237OtherVariant::B(e) => {1238f.debug_tuple("OtherVariant::B").field(e).finish()1239}1240OtherVariant::C(e) => {1241f.debug_tuple("OtherVariant::C").field(e).finish()1242}1243}1244}1245}1246const _: () = {1247assert!(124812 == < OtherVariant as wasmtime::component::ComponentType1249>::SIZE321250);1251assert!(12524 == < OtherVariant as wasmtime::component::ComponentType1253>::ALIGN321254);1255};1256#[derive(wasmtime::component::ComponentType)]1257#[derive(wasmtime::component::Lift)]1258#[derive(wasmtime::component::Lower)]1259#[component(variant)]1260#[derive(Clone)]1261pub enum SomeVariant {1262#[component(name = "a")]1263A(wasmtime::component::__internal::String),1264#[component(name = "b")]1265B,1266#[component(name = "c")]1267C(u32),1268#[component(name = "d")]1269D(wasmtime::component::__internal::Vec<OtherVariant>),1270}1271impl core::fmt::Debug for SomeVariant {1272fn fmt(1273&self,1274f: &mut core::fmt::Formatter<'_>,1275) -> core::fmt::Result {1276match self {1277SomeVariant::A(e) => {1278f.debug_tuple("SomeVariant::A").field(e).finish()1279}1280SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),1281SomeVariant::C(e) => {1282f.debug_tuple("SomeVariant::C").field(e).finish()1283}1284SomeVariant::D(e) => {1285f.debug_tuple("SomeVariant::D").field(e).finish()1286}1287}1288}1289}1290const _: () = {1291assert!(129212 == < SomeVariant as wasmtime::component::ComponentType1293>::SIZE321294);1295assert!(12964 == < SomeVariant as wasmtime::component::ComponentType1297>::ALIGN321298);1299};1300pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<1301(1302wasmtime::component::__internal::String,1303u8,1304i8,1305u16,1306i16,1307u32,1308i32,1309u64,1310i64,1311f32,1312f64,1313char,1314),1315>;1316const _: () = {1317assert!(13188 == < LoadStoreAllSizes as wasmtime::component::ComponentType1319>::SIZE321320);1321assert!(13224 == < LoadStoreAllSizes as wasmtime::component::ComponentType1323>::ALIGN321324);1325};1326pub struct Guest {1327list_u8_param: wasmtime::component::Func,1328list_u16_param: wasmtime::component::Func,1329list_u32_param: wasmtime::component::Func,1330list_u64_param: wasmtime::component::Func,1331list_s8_param: wasmtime::component::Func,1332list_s16_param: wasmtime::component::Func,1333list_s32_param: wasmtime::component::Func,1334list_s64_param: wasmtime::component::Func,1335list_f32_param: wasmtime::component::Func,1336list_f64_param: wasmtime::component::Func,1337list_u8_ret: wasmtime::component::Func,1338list_u16_ret: wasmtime::component::Func,1339list_u32_ret: wasmtime::component::Func,1340list_u64_ret: wasmtime::component::Func,1341list_s8_ret: wasmtime::component::Func,1342list_s16_ret: wasmtime::component::Func,1343list_s32_ret: wasmtime::component::Func,1344list_s64_ret: wasmtime::component::Func,1345list_f32_ret: wasmtime::component::Func,1346list_f64_ret: wasmtime::component::Func,1347tuple_list: wasmtime::component::Func,1348string_list_arg: wasmtime::component::Func,1349string_list_ret: wasmtime::component::Func,1350tuple_string_list: wasmtime::component::Func,1351string_list: wasmtime::component::Func,1352record_list: wasmtime::component::Func,1353record_list_reverse: wasmtime::component::Func,1354variant_list: wasmtime::component::Func,1355load_store_everything: wasmtime::component::Func,1356}1357#[derive(Clone)]1358pub struct GuestIndices {1359list_u8_param: wasmtime::component::ComponentExportIndex,1360list_u16_param: wasmtime::component::ComponentExportIndex,1361list_u32_param: wasmtime::component::ComponentExportIndex,1362list_u64_param: wasmtime::component::ComponentExportIndex,1363list_s8_param: wasmtime::component::ComponentExportIndex,1364list_s16_param: wasmtime::component::ComponentExportIndex,1365list_s32_param: wasmtime::component::ComponentExportIndex,1366list_s64_param: wasmtime::component::ComponentExportIndex,1367list_f32_param: wasmtime::component::ComponentExportIndex,1368list_f64_param: wasmtime::component::ComponentExportIndex,1369list_u8_ret: wasmtime::component::ComponentExportIndex,1370list_u16_ret: wasmtime::component::ComponentExportIndex,1371list_u32_ret: wasmtime::component::ComponentExportIndex,1372list_u64_ret: wasmtime::component::ComponentExportIndex,1373list_s8_ret: wasmtime::component::ComponentExportIndex,1374list_s16_ret: wasmtime::component::ComponentExportIndex,1375list_s32_ret: wasmtime::component::ComponentExportIndex,1376list_s64_ret: wasmtime::component::ComponentExportIndex,1377list_f32_ret: wasmtime::component::ComponentExportIndex,1378list_f64_ret: wasmtime::component::ComponentExportIndex,1379tuple_list: wasmtime::component::ComponentExportIndex,1380string_list_arg: wasmtime::component::ComponentExportIndex,1381string_list_ret: wasmtime::component::ComponentExportIndex,1382tuple_string_list: wasmtime::component::ComponentExportIndex,1383string_list: wasmtime::component::ComponentExportIndex,1384record_list: wasmtime::component::ComponentExportIndex,1385record_list_reverse: wasmtime::component::ComponentExportIndex,1386variant_list: wasmtime::component::ComponentExportIndex,1387load_store_everything: wasmtime::component::ComponentExportIndex,1388}1389impl GuestIndices {1390/// Constructor for [`GuestIndices`] which takes a1391/// [`Component`](wasmtime::component::Component) as input and can be executed1392/// before instantiation.1393///1394/// This constructor can be used to front-load string lookups to find exports1395/// within a component.1396pub fn new<_T>(1397_instance_pre: &wasmtime::component::InstancePre<_T>,1398) -> wasmtime::Result<GuestIndices> {1399let instance = _instance_pre1400.component()1401.get_export_index(None, "foo:foo/lists")1402.ok_or_else(|| {1403anyhow::anyhow!(1404"no exported instance named `foo:foo/lists`"1405)1406})?;1407let mut lookup = move |name| {1408_instance_pre1409.component()1410.get_export_index(Some(&instance), name)1411.ok_or_else(|| {1412anyhow::anyhow!(1413"instance export `foo:foo/lists` does \1414not have export `{name}`"1415)1416})1417};1418let _ = &mut lookup;1419let list_u8_param = lookup("list-u8-param")?;1420let list_u16_param = lookup("list-u16-param")?;1421let list_u32_param = lookup("list-u32-param")?;1422let list_u64_param = lookup("list-u64-param")?;1423let list_s8_param = lookup("list-s8-param")?;1424let list_s16_param = lookup("list-s16-param")?;1425let list_s32_param = lookup("list-s32-param")?;1426let list_s64_param = lookup("list-s64-param")?;1427let list_f32_param = lookup("list-f32-param")?;1428let list_f64_param = lookup("list-f64-param")?;1429let list_u8_ret = lookup("list-u8-ret")?;1430let list_u16_ret = lookup("list-u16-ret")?;1431let list_u32_ret = lookup("list-u32-ret")?;1432let list_u64_ret = lookup("list-u64-ret")?;1433let list_s8_ret = lookup("list-s8-ret")?;1434let list_s16_ret = lookup("list-s16-ret")?;1435let list_s32_ret = lookup("list-s32-ret")?;1436let list_s64_ret = lookup("list-s64-ret")?;1437let list_f32_ret = lookup("list-f32-ret")?;1438let list_f64_ret = lookup("list-f64-ret")?;1439let tuple_list = lookup("tuple-list")?;1440let string_list_arg = lookup("string-list-arg")?;1441let string_list_ret = lookup("string-list-ret")?;1442let tuple_string_list = lookup("tuple-string-list")?;1443let string_list = lookup("string-list")?;1444let record_list = lookup("record-list")?;1445let record_list_reverse = lookup("record-list-reverse")?;1446let variant_list = lookup("variant-list")?;1447let load_store_everything = lookup("load-store-everything")?;1448Ok(GuestIndices {1449list_u8_param,1450list_u16_param,1451list_u32_param,1452list_u64_param,1453list_s8_param,1454list_s16_param,1455list_s32_param,1456list_s64_param,1457list_f32_param,1458list_f64_param,1459list_u8_ret,1460list_u16_ret,1461list_u32_ret,1462list_u64_ret,1463list_s8_ret,1464list_s16_ret,1465list_s32_ret,1466list_s64_ret,1467list_f32_ret,1468list_f64_ret,1469tuple_list,1470string_list_arg,1471string_list_ret,1472tuple_string_list,1473string_list,1474record_list,1475record_list_reverse,1476variant_list,1477load_store_everything,1478})1479}1480pub fn load(1481&self,1482mut store: impl wasmtime::AsContextMut,1483instance: &wasmtime::component::Instance,1484) -> wasmtime::Result<Guest> {1485let _instance = instance;1486let _instance_pre = _instance.instance_pre(&store);1487let _instance_type = _instance_pre.instance_type();1488let mut store = store.as_context_mut();1489let _ = &mut store;1490let list_u8_param = *_instance1491.get_typed_func::<1492(&[u8],),1493(),1494>(&mut store, &self.list_u8_param)?1495.func();1496let list_u16_param = *_instance1497.get_typed_func::<1498(&[u16],),1499(),1500>(&mut store, &self.list_u16_param)?1501.func();1502let list_u32_param = *_instance1503.get_typed_func::<1504(&[u32],),1505(),1506>(&mut store, &self.list_u32_param)?1507.func();1508let list_u64_param = *_instance1509.get_typed_func::<1510(&[u64],),1511(),1512>(&mut store, &self.list_u64_param)?1513.func();1514let list_s8_param = *_instance1515.get_typed_func::<1516(&[i8],),1517(),1518>(&mut store, &self.list_s8_param)?1519.func();1520let list_s16_param = *_instance1521.get_typed_func::<1522(&[i16],),1523(),1524>(&mut store, &self.list_s16_param)?1525.func();1526let list_s32_param = *_instance1527.get_typed_func::<1528(&[i32],),1529(),1530>(&mut store, &self.list_s32_param)?1531.func();1532let list_s64_param = *_instance1533.get_typed_func::<1534(&[i64],),1535(),1536>(&mut store, &self.list_s64_param)?1537.func();1538let list_f32_param = *_instance1539.get_typed_func::<1540(&[f32],),1541(),1542>(&mut store, &self.list_f32_param)?1543.func();1544let list_f64_param = *_instance1545.get_typed_func::<1546(&[f64],),1547(),1548>(&mut store, &self.list_f64_param)?1549.func();1550let list_u8_ret = *_instance1551.get_typed_func::<1552(),1553(wasmtime::component::__internal::Vec<u8>,),1554>(&mut store, &self.list_u8_ret)?1555.func();1556let list_u16_ret = *_instance1557.get_typed_func::<1558(),1559(wasmtime::component::__internal::Vec<u16>,),1560>(&mut store, &self.list_u16_ret)?1561.func();1562let list_u32_ret = *_instance1563.get_typed_func::<1564(),1565(wasmtime::component::__internal::Vec<u32>,),1566>(&mut store, &self.list_u32_ret)?1567.func();1568let list_u64_ret = *_instance1569.get_typed_func::<1570(),1571(wasmtime::component::__internal::Vec<u64>,),1572>(&mut store, &self.list_u64_ret)?1573.func();1574let list_s8_ret = *_instance1575.get_typed_func::<1576(),1577(wasmtime::component::__internal::Vec<i8>,),1578>(&mut store, &self.list_s8_ret)?1579.func();1580let list_s16_ret = *_instance1581.get_typed_func::<1582(),1583(wasmtime::component::__internal::Vec<i16>,),1584>(&mut store, &self.list_s16_ret)?1585.func();1586let list_s32_ret = *_instance1587.get_typed_func::<1588(),1589(wasmtime::component::__internal::Vec<i32>,),1590>(&mut store, &self.list_s32_ret)?1591.func();1592let list_s64_ret = *_instance1593.get_typed_func::<1594(),1595(wasmtime::component::__internal::Vec<i64>,),1596>(&mut store, &self.list_s64_ret)?1597.func();1598let list_f32_ret = *_instance1599.get_typed_func::<1600(),1601(wasmtime::component::__internal::Vec<f32>,),1602>(&mut store, &self.list_f32_ret)?1603.func();1604let list_f64_ret = *_instance1605.get_typed_func::<1606(),1607(wasmtime::component::__internal::Vec<f64>,),1608>(&mut store, &self.list_f64_ret)?1609.func();1610let tuple_list = *_instance1611.get_typed_func::<1612(&[(u8, i8)],),1613(wasmtime::component::__internal::Vec<(i64, u32)>,),1614>(&mut store, &self.tuple_list)?1615.func();1616let string_list_arg = *_instance1617.get_typed_func::<1618(&[wasmtime::component::__internal::String],),1619(),1620>(&mut store, &self.string_list_arg)?1621.func();1622let string_list_ret = *_instance1623.get_typed_func::<1624(),1625(1626wasmtime::component::__internal::Vec<1627wasmtime::component::__internal::String,1628>,1629),1630>(&mut store, &self.string_list_ret)?1631.func();1632let tuple_string_list = *_instance1633.get_typed_func::<1634(&[(u8, wasmtime::component::__internal::String)],),1635(1636wasmtime::component::__internal::Vec<1637(wasmtime::component::__internal::String, u8),1638>,1639),1640>(&mut store, &self.tuple_string_list)?1641.func();1642let string_list = *_instance1643.get_typed_func::<1644(&[wasmtime::component::__internal::String],),1645(1646wasmtime::component::__internal::Vec<1647wasmtime::component::__internal::String,1648>,1649),1650>(&mut store, &self.string_list)?1651.func();1652let record_list = *_instance1653.get_typed_func::<1654(&[SomeRecord],),1655(wasmtime::component::__internal::Vec<OtherRecord>,),1656>(&mut store, &self.record_list)?1657.func();1658let record_list_reverse = *_instance1659.get_typed_func::<1660(&[OtherRecord],),1661(wasmtime::component::__internal::Vec<SomeRecord>,),1662>(&mut store, &self.record_list_reverse)?1663.func();1664let variant_list = *_instance1665.get_typed_func::<1666(&[SomeVariant],),1667(wasmtime::component::__internal::Vec<OtherVariant>,),1668>(&mut store, &self.variant_list)?1669.func();1670let load_store_everything = *_instance1671.get_typed_func::<1672(&LoadStoreAllSizes,),1673(LoadStoreAllSizes,),1674>(&mut store, &self.load_store_everything)?1675.func();1676Ok(Guest {1677list_u8_param,1678list_u16_param,1679list_u32_param,1680list_u64_param,1681list_s8_param,1682list_s16_param,1683list_s32_param,1684list_s64_param,1685list_f32_param,1686list_f64_param,1687list_u8_ret,1688list_u16_ret,1689list_u32_ret,1690list_u64_ret,1691list_s8_ret,1692list_s16_ret,1693list_s32_ret,1694list_s64_ret,1695list_f32_ret,1696list_f64_ret,1697tuple_list,1698string_list_arg,1699string_list_ret,1700tuple_string_list,1701string_list,1702record_list,1703record_list_reverse,1704variant_list,1705load_store_everything,1706})1707}1708}1709impl Guest {1710pub async fn call_list_u8_param<S: wasmtime::AsContextMut>(1711&self,1712mut store: S,1713arg0: &[u8],1714) -> wasmtime::Result<()>1715where1716<S as wasmtime::AsContext>::Data: Send,1717{1718let callee = unsafe {1719wasmtime::component::TypedFunc::<1720(&[u8],),1721(),1722>::new_unchecked(self.list_u8_param)1723};1724let () = callee1725.call_async(store.as_context_mut(), (arg0,))1726.await?;1727callee.post_return_async(store.as_context_mut()).await?;1728Ok(())1729}1730pub async fn call_list_u16_param<S: wasmtime::AsContextMut>(1731&self,1732mut store: S,1733arg0: &[u16],1734) -> wasmtime::Result<()>1735where1736<S as wasmtime::AsContext>::Data: Send,1737{1738let callee = unsafe {1739wasmtime::component::TypedFunc::<1740(&[u16],),1741(),1742>::new_unchecked(self.list_u16_param)1743};1744let () = callee1745.call_async(store.as_context_mut(), (arg0,))1746.await?;1747callee.post_return_async(store.as_context_mut()).await?;1748Ok(())1749}1750pub async fn call_list_u32_param<S: wasmtime::AsContextMut>(1751&self,1752mut store: S,1753arg0: &[u32],1754) -> wasmtime::Result<()>1755where1756<S as wasmtime::AsContext>::Data: Send,1757{1758let callee = unsafe {1759wasmtime::component::TypedFunc::<1760(&[u32],),1761(),1762>::new_unchecked(self.list_u32_param)1763};1764let () = callee1765.call_async(store.as_context_mut(), (arg0,))1766.await?;1767callee.post_return_async(store.as_context_mut()).await?;1768Ok(())1769}1770pub async fn call_list_u64_param<S: wasmtime::AsContextMut>(1771&self,1772mut store: S,1773arg0: &[u64],1774) -> wasmtime::Result<()>1775where1776<S as wasmtime::AsContext>::Data: Send,1777{1778let callee = unsafe {1779wasmtime::component::TypedFunc::<1780(&[u64],),1781(),1782>::new_unchecked(self.list_u64_param)1783};1784let () = callee1785.call_async(store.as_context_mut(), (arg0,))1786.await?;1787callee.post_return_async(store.as_context_mut()).await?;1788Ok(())1789}1790pub async fn call_list_s8_param<S: wasmtime::AsContextMut>(1791&self,1792mut store: S,1793arg0: &[i8],1794) -> wasmtime::Result<()>1795where1796<S as wasmtime::AsContext>::Data: Send,1797{1798let callee = unsafe {1799wasmtime::component::TypedFunc::<1800(&[i8],),1801(),1802>::new_unchecked(self.list_s8_param)1803};1804let () = callee1805.call_async(store.as_context_mut(), (arg0,))1806.await?;1807callee.post_return_async(store.as_context_mut()).await?;1808Ok(())1809}1810pub async fn call_list_s16_param<S: wasmtime::AsContextMut>(1811&self,1812mut store: S,1813arg0: &[i16],1814) -> wasmtime::Result<()>1815where1816<S as wasmtime::AsContext>::Data: Send,1817{1818let callee = unsafe {1819wasmtime::component::TypedFunc::<1820(&[i16],),1821(),1822>::new_unchecked(self.list_s16_param)1823};1824let () = callee1825.call_async(store.as_context_mut(), (arg0,))1826.await?;1827callee.post_return_async(store.as_context_mut()).await?;1828Ok(())1829}1830pub async fn call_list_s32_param<S: wasmtime::AsContextMut>(1831&self,1832mut store: S,1833arg0: &[i32],1834) -> wasmtime::Result<()>1835where1836<S as wasmtime::AsContext>::Data: Send,1837{1838let callee = unsafe {1839wasmtime::component::TypedFunc::<1840(&[i32],),1841(),1842>::new_unchecked(self.list_s32_param)1843};1844let () = callee1845.call_async(store.as_context_mut(), (arg0,))1846.await?;1847callee.post_return_async(store.as_context_mut()).await?;1848Ok(())1849}1850pub async fn call_list_s64_param<S: wasmtime::AsContextMut>(1851&self,1852mut store: S,1853arg0: &[i64],1854) -> wasmtime::Result<()>1855where1856<S as wasmtime::AsContext>::Data: Send,1857{1858let callee = unsafe {1859wasmtime::component::TypedFunc::<1860(&[i64],),1861(),1862>::new_unchecked(self.list_s64_param)1863};1864let () = callee1865.call_async(store.as_context_mut(), (arg0,))1866.await?;1867callee.post_return_async(store.as_context_mut()).await?;1868Ok(())1869}1870pub async fn call_list_f32_param<S: wasmtime::AsContextMut>(1871&self,1872mut store: S,1873arg0: &[f32],1874) -> wasmtime::Result<()>1875where1876<S as wasmtime::AsContext>::Data: Send,1877{1878let callee = unsafe {1879wasmtime::component::TypedFunc::<1880(&[f32],),1881(),1882>::new_unchecked(self.list_f32_param)1883};1884let () = callee1885.call_async(store.as_context_mut(), (arg0,))1886.await?;1887callee.post_return_async(store.as_context_mut()).await?;1888Ok(())1889}1890pub async fn call_list_f64_param<S: wasmtime::AsContextMut>(1891&self,1892mut store: S,1893arg0: &[f64],1894) -> wasmtime::Result<()>1895where1896<S as wasmtime::AsContext>::Data: Send,1897{1898let callee = unsafe {1899wasmtime::component::TypedFunc::<1900(&[f64],),1901(),1902>::new_unchecked(self.list_f64_param)1903};1904let () = callee1905.call_async(store.as_context_mut(), (arg0,))1906.await?;1907callee.post_return_async(store.as_context_mut()).await?;1908Ok(())1909}1910pub async fn call_list_u8_ret<S: wasmtime::AsContextMut>(1911&self,1912mut store: S,1913) -> wasmtime::Result<wasmtime::component::__internal::Vec<u8>>1914where1915<S as wasmtime::AsContext>::Data: Send,1916{1917let callee = unsafe {1918wasmtime::component::TypedFunc::<1919(),1920(wasmtime::component::__internal::Vec<u8>,),1921>::new_unchecked(self.list_u8_ret)1922};1923let (ret0,) = callee1924.call_async(store.as_context_mut(), ())1925.await?;1926callee.post_return_async(store.as_context_mut()).await?;1927Ok(ret0)1928}1929pub async fn call_list_u16_ret<S: wasmtime::AsContextMut>(1930&self,1931mut store: S,1932) -> wasmtime::Result<wasmtime::component::__internal::Vec<u16>>1933where1934<S as wasmtime::AsContext>::Data: Send,1935{1936let callee = unsafe {1937wasmtime::component::TypedFunc::<1938(),1939(wasmtime::component::__internal::Vec<u16>,),1940>::new_unchecked(self.list_u16_ret)1941};1942let (ret0,) = callee1943.call_async(store.as_context_mut(), ())1944.await?;1945callee.post_return_async(store.as_context_mut()).await?;1946Ok(ret0)1947}1948pub async fn call_list_u32_ret<S: wasmtime::AsContextMut>(1949&self,1950mut store: S,1951) -> wasmtime::Result<wasmtime::component::__internal::Vec<u32>>1952where1953<S as wasmtime::AsContext>::Data: Send,1954{1955let callee = unsafe {1956wasmtime::component::TypedFunc::<1957(),1958(wasmtime::component::__internal::Vec<u32>,),1959>::new_unchecked(self.list_u32_ret)1960};1961let (ret0,) = callee1962.call_async(store.as_context_mut(), ())1963.await?;1964callee.post_return_async(store.as_context_mut()).await?;1965Ok(ret0)1966}1967pub async fn call_list_u64_ret<S: wasmtime::AsContextMut>(1968&self,1969mut store: S,1970) -> wasmtime::Result<wasmtime::component::__internal::Vec<u64>>1971where1972<S as wasmtime::AsContext>::Data: Send,1973{1974let callee = unsafe {1975wasmtime::component::TypedFunc::<1976(),1977(wasmtime::component::__internal::Vec<u64>,),1978>::new_unchecked(self.list_u64_ret)1979};1980let (ret0,) = callee1981.call_async(store.as_context_mut(), ())1982.await?;1983callee.post_return_async(store.as_context_mut()).await?;1984Ok(ret0)1985}1986pub async fn call_list_s8_ret<S: wasmtime::AsContextMut>(1987&self,1988mut store: S,1989) -> wasmtime::Result<wasmtime::component::__internal::Vec<i8>>1990where1991<S as wasmtime::AsContext>::Data: Send,1992{1993let callee = unsafe {1994wasmtime::component::TypedFunc::<1995(),1996(wasmtime::component::__internal::Vec<i8>,),1997>::new_unchecked(self.list_s8_ret)1998};1999let (ret0,) = callee2000.call_async(store.as_context_mut(), ())2001.await?;2002callee.post_return_async(store.as_context_mut()).await?;2003Ok(ret0)2004}2005pub async fn call_list_s16_ret<S: wasmtime::AsContextMut>(2006&self,2007mut store: S,2008) -> wasmtime::Result<wasmtime::component::__internal::Vec<i16>>2009where2010<S as wasmtime::AsContext>::Data: Send,2011{2012let callee = unsafe {2013wasmtime::component::TypedFunc::<2014(),2015(wasmtime::component::__internal::Vec<i16>,),2016>::new_unchecked(self.list_s16_ret)2017};2018let (ret0,) = callee2019.call_async(store.as_context_mut(), ())2020.await?;2021callee.post_return_async(store.as_context_mut()).await?;2022Ok(ret0)2023}2024pub async fn call_list_s32_ret<S: wasmtime::AsContextMut>(2025&self,2026mut store: S,2027) -> wasmtime::Result<wasmtime::component::__internal::Vec<i32>>2028where2029<S as wasmtime::AsContext>::Data: Send,2030{2031let callee = unsafe {2032wasmtime::component::TypedFunc::<2033(),2034(wasmtime::component::__internal::Vec<i32>,),2035>::new_unchecked(self.list_s32_ret)2036};2037let (ret0,) = callee2038.call_async(store.as_context_mut(), ())2039.await?;2040callee.post_return_async(store.as_context_mut()).await?;2041Ok(ret0)2042}2043pub async fn call_list_s64_ret<S: wasmtime::AsContextMut>(2044&self,2045mut store: S,2046) -> wasmtime::Result<wasmtime::component::__internal::Vec<i64>>2047where2048<S as wasmtime::AsContext>::Data: Send,2049{2050let callee = unsafe {2051wasmtime::component::TypedFunc::<2052(),2053(wasmtime::component::__internal::Vec<i64>,),2054>::new_unchecked(self.list_s64_ret)2055};2056let (ret0,) = callee2057.call_async(store.as_context_mut(), ())2058.await?;2059callee.post_return_async(store.as_context_mut()).await?;2060Ok(ret0)2061}2062pub async fn call_list_f32_ret<S: wasmtime::AsContextMut>(2063&self,2064mut store: S,2065) -> wasmtime::Result<wasmtime::component::__internal::Vec<f32>>2066where2067<S as wasmtime::AsContext>::Data: Send,2068{2069let callee = unsafe {2070wasmtime::component::TypedFunc::<2071(),2072(wasmtime::component::__internal::Vec<f32>,),2073>::new_unchecked(self.list_f32_ret)2074};2075let (ret0,) = callee2076.call_async(store.as_context_mut(), ())2077.await?;2078callee.post_return_async(store.as_context_mut()).await?;2079Ok(ret0)2080}2081pub async fn call_list_f64_ret<S: wasmtime::AsContextMut>(2082&self,2083mut store: S,2084) -> wasmtime::Result<wasmtime::component::__internal::Vec<f64>>2085where2086<S as wasmtime::AsContext>::Data: Send,2087{2088let callee = unsafe {2089wasmtime::component::TypedFunc::<2090(),2091(wasmtime::component::__internal::Vec<f64>,),2092>::new_unchecked(self.list_f64_ret)2093};2094let (ret0,) = callee2095.call_async(store.as_context_mut(), ())2096.await?;2097callee.post_return_async(store.as_context_mut()).await?;2098Ok(ret0)2099}2100pub async fn call_tuple_list<S: wasmtime::AsContextMut>(2101&self,2102mut store: S,2103arg0: &[(u8, i8)],2104) -> wasmtime::Result<2105wasmtime::component::__internal::Vec<(i64, u32)>,2106>2107where2108<S as wasmtime::AsContext>::Data: Send,2109{2110let callee = unsafe {2111wasmtime::component::TypedFunc::<2112(&[(u8, i8)],),2113(wasmtime::component::__internal::Vec<(i64, u32)>,),2114>::new_unchecked(self.tuple_list)2115};2116let (ret0,) = callee2117.call_async(store.as_context_mut(), (arg0,))2118.await?;2119callee.post_return_async(store.as_context_mut()).await?;2120Ok(ret0)2121}2122pub async fn call_string_list_arg<S: wasmtime::AsContextMut>(2123&self,2124mut store: S,2125arg0: &[wasmtime::component::__internal::String],2126) -> wasmtime::Result<()>2127where2128<S as wasmtime::AsContext>::Data: Send,2129{2130let callee = unsafe {2131wasmtime::component::TypedFunc::<2132(&[wasmtime::component::__internal::String],),2133(),2134>::new_unchecked(self.string_list_arg)2135};2136let () = callee2137.call_async(store.as_context_mut(), (arg0,))2138.await?;2139callee.post_return_async(store.as_context_mut()).await?;2140Ok(())2141}2142pub async fn call_string_list_ret<S: wasmtime::AsContextMut>(2143&self,2144mut store: S,2145) -> wasmtime::Result<2146wasmtime::component::__internal::Vec<2147wasmtime::component::__internal::String,2148>,2149>2150where2151<S as wasmtime::AsContext>::Data: Send,2152{2153let callee = unsafe {2154wasmtime::component::TypedFunc::<2155(),2156(2157wasmtime::component::__internal::Vec<2158wasmtime::component::__internal::String,2159>,2160),2161>::new_unchecked(self.string_list_ret)2162};2163let (ret0,) = callee2164.call_async(store.as_context_mut(), ())2165.await?;2166callee.post_return_async(store.as_context_mut()).await?;2167Ok(ret0)2168}2169pub async fn call_tuple_string_list<S: wasmtime::AsContextMut>(2170&self,2171mut store: S,2172arg0: &[(u8, wasmtime::component::__internal::String)],2173) -> wasmtime::Result<2174wasmtime::component::__internal::Vec<2175(wasmtime::component::__internal::String, u8),2176>,2177>2178where2179<S as wasmtime::AsContext>::Data: Send,2180{2181let callee = unsafe {2182wasmtime::component::TypedFunc::<2183(&[(u8, wasmtime::component::__internal::String)],),2184(2185wasmtime::component::__internal::Vec<2186(wasmtime::component::__internal::String, u8),2187>,2188),2189>::new_unchecked(self.tuple_string_list)2190};2191let (ret0,) = callee2192.call_async(store.as_context_mut(), (arg0,))2193.await?;2194callee.post_return_async(store.as_context_mut()).await?;2195Ok(ret0)2196}2197pub async fn call_string_list<S: wasmtime::AsContextMut>(2198&self,2199mut store: S,2200arg0: &[wasmtime::component::__internal::String],2201) -> wasmtime::Result<2202wasmtime::component::__internal::Vec<2203wasmtime::component::__internal::String,2204>,2205>2206where2207<S as wasmtime::AsContext>::Data: Send,2208{2209let callee = unsafe {2210wasmtime::component::TypedFunc::<2211(&[wasmtime::component::__internal::String],),2212(2213wasmtime::component::__internal::Vec<2214wasmtime::component::__internal::String,2215>,2216),2217>::new_unchecked(self.string_list)2218};2219let (ret0,) = callee2220.call_async(store.as_context_mut(), (arg0,))2221.await?;2222callee.post_return_async(store.as_context_mut()).await?;2223Ok(ret0)2224}2225pub async fn call_record_list<S: wasmtime::AsContextMut>(2226&self,2227mut store: S,2228arg0: &[SomeRecord],2229) -> wasmtime::Result<2230wasmtime::component::__internal::Vec<OtherRecord>,2231>2232where2233<S as wasmtime::AsContext>::Data: Send,2234{2235let callee = unsafe {2236wasmtime::component::TypedFunc::<2237(&[SomeRecord],),2238(wasmtime::component::__internal::Vec<OtherRecord>,),2239>::new_unchecked(self.record_list)2240};2241let (ret0,) = callee2242.call_async(store.as_context_mut(), (arg0,))2243.await?;2244callee.post_return_async(store.as_context_mut()).await?;2245Ok(ret0)2246}2247pub async fn call_record_list_reverse<S: wasmtime::AsContextMut>(2248&self,2249mut store: S,2250arg0: &[OtherRecord],2251) -> wasmtime::Result<2252wasmtime::component::__internal::Vec<SomeRecord>,2253>2254where2255<S as wasmtime::AsContext>::Data: Send,2256{2257let callee = unsafe {2258wasmtime::component::TypedFunc::<2259(&[OtherRecord],),2260(wasmtime::component::__internal::Vec<SomeRecord>,),2261>::new_unchecked(self.record_list_reverse)2262};2263let (ret0,) = callee2264.call_async(store.as_context_mut(), (arg0,))2265.await?;2266callee.post_return_async(store.as_context_mut()).await?;2267Ok(ret0)2268}2269pub async fn call_variant_list<S: wasmtime::AsContextMut>(2270&self,2271mut store: S,2272arg0: &[SomeVariant],2273) -> wasmtime::Result<2274wasmtime::component::__internal::Vec<OtherVariant>,2275>2276where2277<S as wasmtime::AsContext>::Data: Send,2278{2279let callee = unsafe {2280wasmtime::component::TypedFunc::<2281(&[SomeVariant],),2282(wasmtime::component::__internal::Vec<OtherVariant>,),2283>::new_unchecked(self.variant_list)2284};2285let (ret0,) = callee2286.call_async(store.as_context_mut(), (arg0,))2287.await?;2288callee.post_return_async(store.as_context_mut()).await?;2289Ok(ret0)2290}2291pub async fn call_load_store_everything<S: wasmtime::AsContextMut>(2292&self,2293mut store: S,2294arg0: &LoadStoreAllSizes,2295) -> wasmtime::Result<LoadStoreAllSizes>2296where2297<S as wasmtime::AsContext>::Data: Send,2298{2299let callee = unsafe {2300wasmtime::component::TypedFunc::<2301(&LoadStoreAllSizes,),2302(LoadStoreAllSizes,),2303>::new_unchecked(self.load_store_everything)2304};2305let (ret0,) = callee2306.call_async(store.as_context_mut(), (arg0,))2307.await?;2308callee.post_return_async(store.as_context_mut()).await?;2309Ok(ret0)2310}2311}2312}2313}2314}2315}231623172318