Path: blob/main/crates/component-macro/tests/expanded/lists_tracing_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{758use tracing::Instrument;759let span = tracing::span!(760tracing::Level::TRACE, "wit-bindgen import", module =761"lists", function = "list-u8-param",762);763wasmtime::component::__internal::Box::new(764async move {765tracing::event!(766tracing::Level::TRACE, x = tracing::field::debug("..."),767"call"768);769let host = &mut host_getter(caller.data_mut());770let r = Host::list_u8_param(host, arg0).await;771tracing::event!(772tracing::Level::TRACE, result = tracing::field::debug(& r),773"return"774);775Ok(r)776}777.instrument(span),778)779},780)?;781inst.func_wrap_async(782"list-u16-param",783move |784mut caller: wasmtime::StoreContextMut<'_, T>,785(arg0,): (wasmtime::component::__internal::Vec<u16>,)|786{787use tracing::Instrument;788let span = tracing::span!(789tracing::Level::TRACE, "wit-bindgen import", module =790"lists", function = "list-u16-param",791);792wasmtime::component::__internal::Box::new(793async move {794tracing::event!(795tracing::Level::TRACE, x = tracing::field::debug("..."),796"call"797);798let host = &mut host_getter(caller.data_mut());799let r = Host::list_u16_param(host, arg0).await;800tracing::event!(801tracing::Level::TRACE, result = tracing::field::debug(& r),802"return"803);804Ok(r)805}806.instrument(span),807)808},809)?;810inst.func_wrap_async(811"list-u32-param",812move |813mut caller: wasmtime::StoreContextMut<'_, T>,814(arg0,): (wasmtime::component::__internal::Vec<u32>,)|815{816use tracing::Instrument;817let span = tracing::span!(818tracing::Level::TRACE, "wit-bindgen import", module =819"lists", function = "list-u32-param",820);821wasmtime::component::__internal::Box::new(822async move {823tracing::event!(824tracing::Level::TRACE, x = tracing::field::debug("..."),825"call"826);827let host = &mut host_getter(caller.data_mut());828let r = Host::list_u32_param(host, arg0).await;829tracing::event!(830tracing::Level::TRACE, result = tracing::field::debug(& r),831"return"832);833Ok(r)834}835.instrument(span),836)837},838)?;839inst.func_wrap_async(840"list-u64-param",841move |842mut caller: wasmtime::StoreContextMut<'_, T>,843(arg0,): (wasmtime::component::__internal::Vec<u64>,)|844{845use tracing::Instrument;846let span = tracing::span!(847tracing::Level::TRACE, "wit-bindgen import", module =848"lists", function = "list-u64-param",849);850wasmtime::component::__internal::Box::new(851async move {852tracing::event!(853tracing::Level::TRACE, x = tracing::field::debug("..."),854"call"855);856let host = &mut host_getter(caller.data_mut());857let r = Host::list_u64_param(host, arg0).await;858tracing::event!(859tracing::Level::TRACE, result = tracing::field::debug(& r),860"return"861);862Ok(r)863}864.instrument(span),865)866},867)?;868inst.func_wrap_async(869"list-s8-param",870move |871mut caller: wasmtime::StoreContextMut<'_, T>,872(arg0,): (wasmtime::component::__internal::Vec<i8>,)|873{874use tracing::Instrument;875let span = tracing::span!(876tracing::Level::TRACE, "wit-bindgen import", module =877"lists", function = "list-s8-param",878);879wasmtime::component::__internal::Box::new(880async move {881tracing::event!(882tracing::Level::TRACE, x = tracing::field::debug("..."),883"call"884);885let host = &mut host_getter(caller.data_mut());886let r = Host::list_s8_param(host, arg0).await;887tracing::event!(888tracing::Level::TRACE, result = tracing::field::debug(& r),889"return"890);891Ok(r)892}893.instrument(span),894)895},896)?;897inst.func_wrap_async(898"list-s16-param",899move |900mut caller: wasmtime::StoreContextMut<'_, T>,901(arg0,): (wasmtime::component::__internal::Vec<i16>,)|902{903use tracing::Instrument;904let span = tracing::span!(905tracing::Level::TRACE, "wit-bindgen import", module =906"lists", function = "list-s16-param",907);908wasmtime::component::__internal::Box::new(909async move {910tracing::event!(911tracing::Level::TRACE, x = tracing::field::debug("..."),912"call"913);914let host = &mut host_getter(caller.data_mut());915let r = Host::list_s16_param(host, arg0).await;916tracing::event!(917tracing::Level::TRACE, result = tracing::field::debug(& r),918"return"919);920Ok(r)921}922.instrument(span),923)924},925)?;926inst.func_wrap_async(927"list-s32-param",928move |929mut caller: wasmtime::StoreContextMut<'_, T>,930(arg0,): (wasmtime::component::__internal::Vec<i32>,)|931{932use tracing::Instrument;933let span = tracing::span!(934tracing::Level::TRACE, "wit-bindgen import", module =935"lists", function = "list-s32-param",936);937wasmtime::component::__internal::Box::new(938async move {939tracing::event!(940tracing::Level::TRACE, x = tracing::field::debug("..."),941"call"942);943let host = &mut host_getter(caller.data_mut());944let r = Host::list_s32_param(host, arg0).await;945tracing::event!(946tracing::Level::TRACE, result = tracing::field::debug(& r),947"return"948);949Ok(r)950}951.instrument(span),952)953},954)?;955inst.func_wrap_async(956"list-s64-param",957move |958mut caller: wasmtime::StoreContextMut<'_, T>,959(arg0,): (wasmtime::component::__internal::Vec<i64>,)|960{961use tracing::Instrument;962let span = tracing::span!(963tracing::Level::TRACE, "wit-bindgen import", module =964"lists", function = "list-s64-param",965);966wasmtime::component::__internal::Box::new(967async move {968tracing::event!(969tracing::Level::TRACE, x = tracing::field::debug("..."),970"call"971);972let host = &mut host_getter(caller.data_mut());973let r = Host::list_s64_param(host, arg0).await;974tracing::event!(975tracing::Level::TRACE, result = tracing::field::debug(& r),976"return"977);978Ok(r)979}980.instrument(span),981)982},983)?;984inst.func_wrap_async(985"list-f32-param",986move |987mut caller: wasmtime::StoreContextMut<'_, T>,988(arg0,): (wasmtime::component::__internal::Vec<f32>,)|989{990use tracing::Instrument;991let span = tracing::span!(992tracing::Level::TRACE, "wit-bindgen import", module =993"lists", function = "list-f32-param",994);995wasmtime::component::__internal::Box::new(996async move {997tracing::event!(998tracing::Level::TRACE, x = tracing::field::debug("..."),999"call"1000);1001let host = &mut host_getter(caller.data_mut());1002let r = Host::list_f32_param(host, arg0).await;1003tracing::event!(1004tracing::Level::TRACE, result = tracing::field::debug(& r),1005"return"1006);1007Ok(r)1008}1009.instrument(span),1010)1011},1012)?;1013inst.func_wrap_async(1014"list-f64-param",1015move |1016mut caller: wasmtime::StoreContextMut<'_, T>,1017(arg0,): (wasmtime::component::__internal::Vec<f64>,)|1018{1019use tracing::Instrument;1020let span = tracing::span!(1021tracing::Level::TRACE, "wit-bindgen import", module =1022"lists", function = "list-f64-param",1023);1024wasmtime::component::__internal::Box::new(1025async move {1026tracing::event!(1027tracing::Level::TRACE, x = tracing::field::debug("..."),1028"call"1029);1030let host = &mut host_getter(caller.data_mut());1031let r = Host::list_f64_param(host, arg0).await;1032tracing::event!(1033tracing::Level::TRACE, result = tracing::field::debug(& r),1034"return"1035);1036Ok(r)1037}1038.instrument(span),1039)1040},1041)?;1042inst.func_wrap_async(1043"list-u8-ret",1044move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1045use tracing::Instrument;1046let span = tracing::span!(1047tracing::Level::TRACE, "wit-bindgen import", module =1048"lists", function = "list-u8-ret",1049);1050wasmtime::component::__internal::Box::new(1051async move {1052tracing::event!(tracing::Level::TRACE, "call");1053let host = &mut host_getter(caller.data_mut());1054let r = Host::list_u8_ret(host).await;1055tracing::event!(1056tracing::Level::TRACE, result =1057tracing::field::debug("..."), "return"1058);1059Ok((r,))1060}1061.instrument(span),1062)1063},1064)?;1065inst.func_wrap_async(1066"list-u16-ret",1067move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1068use tracing::Instrument;1069let span = tracing::span!(1070tracing::Level::TRACE, "wit-bindgen import", module =1071"lists", function = "list-u16-ret",1072);1073wasmtime::component::__internal::Box::new(1074async move {1075tracing::event!(tracing::Level::TRACE, "call");1076let host = &mut host_getter(caller.data_mut());1077let r = Host::list_u16_ret(host).await;1078tracing::event!(1079tracing::Level::TRACE, result =1080tracing::field::debug("..."), "return"1081);1082Ok((r,))1083}1084.instrument(span),1085)1086},1087)?;1088inst.func_wrap_async(1089"list-u32-ret",1090move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1091use tracing::Instrument;1092let span = tracing::span!(1093tracing::Level::TRACE, "wit-bindgen import", module =1094"lists", function = "list-u32-ret",1095);1096wasmtime::component::__internal::Box::new(1097async move {1098tracing::event!(tracing::Level::TRACE, "call");1099let host = &mut host_getter(caller.data_mut());1100let r = Host::list_u32_ret(host).await;1101tracing::event!(1102tracing::Level::TRACE, result =1103tracing::field::debug("..."), "return"1104);1105Ok((r,))1106}1107.instrument(span),1108)1109},1110)?;1111inst.func_wrap_async(1112"list-u64-ret",1113move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1114use tracing::Instrument;1115let span = tracing::span!(1116tracing::Level::TRACE, "wit-bindgen import", module =1117"lists", function = "list-u64-ret",1118);1119wasmtime::component::__internal::Box::new(1120async move {1121tracing::event!(tracing::Level::TRACE, "call");1122let host = &mut host_getter(caller.data_mut());1123let r = Host::list_u64_ret(host).await;1124tracing::event!(1125tracing::Level::TRACE, result =1126tracing::field::debug("..."), "return"1127);1128Ok((r,))1129}1130.instrument(span),1131)1132},1133)?;1134inst.func_wrap_async(1135"list-s8-ret",1136move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1137use tracing::Instrument;1138let span = tracing::span!(1139tracing::Level::TRACE, "wit-bindgen import", module =1140"lists", function = "list-s8-ret",1141);1142wasmtime::component::__internal::Box::new(1143async move {1144tracing::event!(tracing::Level::TRACE, "call");1145let host = &mut host_getter(caller.data_mut());1146let r = Host::list_s8_ret(host).await;1147tracing::event!(1148tracing::Level::TRACE, result =1149tracing::field::debug("..."), "return"1150);1151Ok((r,))1152}1153.instrument(span),1154)1155},1156)?;1157inst.func_wrap_async(1158"list-s16-ret",1159move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1160use tracing::Instrument;1161let span = tracing::span!(1162tracing::Level::TRACE, "wit-bindgen import", module =1163"lists", function = "list-s16-ret",1164);1165wasmtime::component::__internal::Box::new(1166async move {1167tracing::event!(tracing::Level::TRACE, "call");1168let host = &mut host_getter(caller.data_mut());1169let r = Host::list_s16_ret(host).await;1170tracing::event!(1171tracing::Level::TRACE, result =1172tracing::field::debug("..."), "return"1173);1174Ok((r,))1175}1176.instrument(span),1177)1178},1179)?;1180inst.func_wrap_async(1181"list-s32-ret",1182move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1183use tracing::Instrument;1184let span = tracing::span!(1185tracing::Level::TRACE, "wit-bindgen import", module =1186"lists", function = "list-s32-ret",1187);1188wasmtime::component::__internal::Box::new(1189async move {1190tracing::event!(tracing::Level::TRACE, "call");1191let host = &mut host_getter(caller.data_mut());1192let r = Host::list_s32_ret(host).await;1193tracing::event!(1194tracing::Level::TRACE, result =1195tracing::field::debug("..."), "return"1196);1197Ok((r,))1198}1199.instrument(span),1200)1201},1202)?;1203inst.func_wrap_async(1204"list-s64-ret",1205move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1206use tracing::Instrument;1207let span = tracing::span!(1208tracing::Level::TRACE, "wit-bindgen import", module =1209"lists", function = "list-s64-ret",1210);1211wasmtime::component::__internal::Box::new(1212async move {1213tracing::event!(tracing::Level::TRACE, "call");1214let host = &mut host_getter(caller.data_mut());1215let r = Host::list_s64_ret(host).await;1216tracing::event!(1217tracing::Level::TRACE, result =1218tracing::field::debug("..."), "return"1219);1220Ok((r,))1221}1222.instrument(span),1223)1224},1225)?;1226inst.func_wrap_async(1227"list-f32-ret",1228move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1229use tracing::Instrument;1230let span = tracing::span!(1231tracing::Level::TRACE, "wit-bindgen import", module =1232"lists", function = "list-f32-ret",1233);1234wasmtime::component::__internal::Box::new(1235async move {1236tracing::event!(tracing::Level::TRACE, "call");1237let host = &mut host_getter(caller.data_mut());1238let r = Host::list_f32_ret(host).await;1239tracing::event!(1240tracing::Level::TRACE, result =1241tracing::field::debug("..."), "return"1242);1243Ok((r,))1244}1245.instrument(span),1246)1247},1248)?;1249inst.func_wrap_async(1250"list-f64-ret",1251move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1252use tracing::Instrument;1253let span = tracing::span!(1254tracing::Level::TRACE, "wit-bindgen import", module =1255"lists", function = "list-f64-ret",1256);1257wasmtime::component::__internal::Box::new(1258async move {1259tracing::event!(tracing::Level::TRACE, "call");1260let host = &mut host_getter(caller.data_mut());1261let r = Host::list_f64_ret(host).await;1262tracing::event!(1263tracing::Level::TRACE, result =1264tracing::field::debug("..."), "return"1265);1266Ok((r,))1267}1268.instrument(span),1269)1270},1271)?;1272inst.func_wrap_async(1273"tuple-list",1274move |1275mut caller: wasmtime::StoreContextMut<'_, T>,1276(arg0,): (wasmtime::component::__internal::Vec<(u8, i8)>,)|1277{1278use tracing::Instrument;1279let span = tracing::span!(1280tracing::Level::TRACE, "wit-bindgen import", module =1281"lists", function = "tuple-list",1282);1283wasmtime::component::__internal::Box::new(1284async move {1285tracing::event!(1286tracing::Level::TRACE, x = tracing::field::debug("..."),1287"call"1288);1289let host = &mut host_getter(caller.data_mut());1290let r = Host::tuple_list(host, arg0).await;1291tracing::event!(1292tracing::Level::TRACE, result =1293tracing::field::debug("..."), "return"1294);1295Ok((r,))1296}1297.instrument(span),1298)1299},1300)?;1301inst.func_wrap_async(1302"string-list-arg",1303move |1304mut caller: wasmtime::StoreContextMut<'_, T>,1305(1306arg0,1307): (1308wasmtime::component::__internal::Vec<1309wasmtime::component::__internal::String,1310>,1311)|1312{1313use tracing::Instrument;1314let span = tracing::span!(1315tracing::Level::TRACE, "wit-bindgen import", module =1316"lists", function = "string-list-arg",1317);1318wasmtime::component::__internal::Box::new(1319async move {1320tracing::event!(1321tracing::Level::TRACE, a = tracing::field::debug("..."),1322"call"1323);1324let host = &mut host_getter(caller.data_mut());1325let r = Host::string_list_arg(host, arg0).await;1326tracing::event!(1327tracing::Level::TRACE, result = tracing::field::debug(& r),1328"return"1329);1330Ok(r)1331}1332.instrument(span),1333)1334},1335)?;1336inst.func_wrap_async(1337"string-list-ret",1338move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {1339use tracing::Instrument;1340let span = tracing::span!(1341tracing::Level::TRACE, "wit-bindgen import", module =1342"lists", function = "string-list-ret",1343);1344wasmtime::component::__internal::Box::new(1345async move {1346tracing::event!(tracing::Level::TRACE, "call");1347let host = &mut host_getter(caller.data_mut());1348let r = Host::string_list_ret(host).await;1349tracing::event!(1350tracing::Level::TRACE, result =1351tracing::field::debug("..."), "return"1352);1353Ok((r,))1354}1355.instrument(span),1356)1357},1358)?;1359inst.func_wrap_async(1360"tuple-string-list",1361move |1362mut caller: wasmtime::StoreContextMut<'_, T>,1363(1364arg0,1365): (1366wasmtime::component::__internal::Vec<1367(u8, wasmtime::component::__internal::String),1368>,1369)|1370{1371use tracing::Instrument;1372let span = tracing::span!(1373tracing::Level::TRACE, "wit-bindgen import", module =1374"lists", function = "tuple-string-list",1375);1376wasmtime::component::__internal::Box::new(1377async move {1378tracing::event!(1379tracing::Level::TRACE, x = tracing::field::debug("..."),1380"call"1381);1382let host = &mut host_getter(caller.data_mut());1383let r = Host::tuple_string_list(host, arg0).await;1384tracing::event!(1385tracing::Level::TRACE, result =1386tracing::field::debug("..."), "return"1387);1388Ok((r,))1389}1390.instrument(span),1391)1392},1393)?;1394inst.func_wrap_async(1395"string-list",1396move |1397mut caller: wasmtime::StoreContextMut<'_, T>,1398(1399arg0,1400): (1401wasmtime::component::__internal::Vec<1402wasmtime::component::__internal::String,1403>,1404)|1405{1406use tracing::Instrument;1407let span = tracing::span!(1408tracing::Level::TRACE, "wit-bindgen import", module =1409"lists", function = "string-list",1410);1411wasmtime::component::__internal::Box::new(1412async move {1413tracing::event!(1414tracing::Level::TRACE, x = tracing::field::debug("..."),1415"call"1416);1417let host = &mut host_getter(caller.data_mut());1418let r = Host::string_list(host, arg0).await;1419tracing::event!(1420tracing::Level::TRACE, result =1421tracing::field::debug("..."), "return"1422);1423Ok((r,))1424}1425.instrument(span),1426)1427},1428)?;1429inst.func_wrap_async(1430"record-list",1431move |1432mut caller: wasmtime::StoreContextMut<'_, T>,1433(arg0,): (wasmtime::component::__internal::Vec<SomeRecord>,)|1434{1435use tracing::Instrument;1436let span = tracing::span!(1437tracing::Level::TRACE, "wit-bindgen import", module =1438"lists", function = "record-list",1439);1440wasmtime::component::__internal::Box::new(1441async move {1442tracing::event!(1443tracing::Level::TRACE, x = tracing::field::debug("..."),1444"call"1445);1446let host = &mut host_getter(caller.data_mut());1447let r = Host::record_list(host, arg0).await;1448tracing::event!(1449tracing::Level::TRACE, result =1450tracing::field::debug("..."), "return"1451);1452Ok((r,))1453}1454.instrument(span),1455)1456},1457)?;1458inst.func_wrap_async(1459"record-list-reverse",1460move |1461mut caller: wasmtime::StoreContextMut<'_, T>,1462(arg0,): (wasmtime::component::__internal::Vec<OtherRecord>,)|1463{1464use tracing::Instrument;1465let span = tracing::span!(1466tracing::Level::TRACE, "wit-bindgen import", module =1467"lists", function = "record-list-reverse",1468);1469wasmtime::component::__internal::Box::new(1470async move {1471tracing::event!(1472tracing::Level::TRACE, x = tracing::field::debug("..."),1473"call"1474);1475let host = &mut host_getter(caller.data_mut());1476let r = Host::record_list_reverse(host, arg0).await;1477tracing::event!(1478tracing::Level::TRACE, result =1479tracing::field::debug("..."), "return"1480);1481Ok((r,))1482}1483.instrument(span),1484)1485},1486)?;1487inst.func_wrap_async(1488"variant-list",1489move |1490mut caller: wasmtime::StoreContextMut<'_, T>,1491(arg0,): (wasmtime::component::__internal::Vec<SomeVariant>,)|1492{1493use tracing::Instrument;1494let span = tracing::span!(1495tracing::Level::TRACE, "wit-bindgen import", module =1496"lists", function = "variant-list",1497);1498wasmtime::component::__internal::Box::new(1499async move {1500tracing::event!(1501tracing::Level::TRACE, x = tracing::field::debug("..."),1502"call"1503);1504let host = &mut host_getter(caller.data_mut());1505let r = Host::variant_list(host, arg0).await;1506tracing::event!(1507tracing::Level::TRACE, result =1508tracing::field::debug("..."), "return"1509);1510Ok((r,))1511}1512.instrument(span),1513)1514},1515)?;1516inst.func_wrap_async(1517"load-store-everything",1518move |1519mut caller: wasmtime::StoreContextMut<'_, T>,1520(arg0,): (LoadStoreAllSizes,)|1521{1522use tracing::Instrument;1523let span = tracing::span!(1524tracing::Level::TRACE, "wit-bindgen import", module =1525"lists", function = "load-store-everything",1526);1527wasmtime::component::__internal::Box::new(1528async move {1529tracing::event!(1530tracing::Level::TRACE, a = tracing::field::debug("..."),1531"call"1532);1533let host = &mut host_getter(caller.data_mut());1534let r = Host::load_store_everything(host, arg0).await;1535tracing::event!(1536tracing::Level::TRACE, result =1537tracing::field::debug("..."), "return"1538);1539Ok((r,))1540}1541.instrument(span),1542)1543},1544)?;1545Ok(())1546}1547}1548}1549}1550pub mod exports {1551pub mod foo {1552pub mod foo {1553#[allow(clippy::all)]1554pub mod lists {1555#[allow(unused_imports)]1556use wasmtime::component::__internal::{anyhow, Box};1557#[derive(wasmtime::component::ComponentType)]1558#[derive(wasmtime::component::Lift)]1559#[derive(wasmtime::component::Lower)]1560#[component(record)]1561#[derive(Clone)]1562pub struct OtherRecord {1563#[component(name = "a1")]1564pub a1: u32,1565#[component(name = "a2")]1566pub a2: u64,1567#[component(name = "a3")]1568pub a3: i32,1569#[component(name = "a4")]1570pub a4: i64,1571#[component(name = "b")]1572pub b: wasmtime::component::__internal::String,1573#[component(name = "c")]1574pub c: wasmtime::component::__internal::Vec<u8>,1575}1576impl core::fmt::Debug for OtherRecord {1577fn fmt(1578&self,1579f: &mut core::fmt::Formatter<'_>,1580) -> core::fmt::Result {1581f.debug_struct("OtherRecord")1582.field("a1", &self.a1)1583.field("a2", &self.a2)1584.field("a3", &self.a3)1585.field("a4", &self.a4)1586.field("b", &self.b)1587.field("c", &self.c)1588.finish()1589}1590}1591const _: () = {1592assert!(159348 == < OtherRecord as wasmtime::component::ComponentType1594>::SIZE321595);1596assert!(15978 == < OtherRecord as wasmtime::component::ComponentType1598>::ALIGN321599);1600};1601#[derive(wasmtime::component::ComponentType)]1602#[derive(wasmtime::component::Lift)]1603#[derive(wasmtime::component::Lower)]1604#[component(record)]1605#[derive(Clone)]1606pub struct SomeRecord {1607#[component(name = "x")]1608pub x: wasmtime::component::__internal::String,1609#[component(name = "y")]1610pub y: OtherRecord,1611#[component(name = "z")]1612pub z: wasmtime::component::__internal::Vec<OtherRecord>,1613#[component(name = "c1")]1614pub c1: u32,1615#[component(name = "c2")]1616pub c2: u64,1617#[component(name = "c3")]1618pub c3: i32,1619#[component(name = "c4")]1620pub c4: i64,1621}1622impl core::fmt::Debug for SomeRecord {1623fn fmt(1624&self,1625f: &mut core::fmt::Formatter<'_>,1626) -> core::fmt::Result {1627f.debug_struct("SomeRecord")1628.field("x", &self.x)1629.field("y", &self.y)1630.field("z", &self.z)1631.field("c1", &self.c1)1632.field("c2", &self.c2)1633.field("c3", &self.c3)1634.field("c4", &self.c4)1635.finish()1636}1637}1638const _: () = {1639assert!(164096 == < SomeRecord as wasmtime::component::ComponentType1641>::SIZE321642);1643assert!(16448 == < SomeRecord as wasmtime::component::ComponentType1645>::ALIGN321646);1647};1648#[derive(wasmtime::component::ComponentType)]1649#[derive(wasmtime::component::Lift)]1650#[derive(wasmtime::component::Lower)]1651#[component(variant)]1652#[derive(Clone)]1653pub enum OtherVariant {1654#[component(name = "a")]1655A,1656#[component(name = "b")]1657B(u32),1658#[component(name = "c")]1659C(wasmtime::component::__internal::String),1660}1661impl core::fmt::Debug for OtherVariant {1662fn fmt(1663&self,1664f: &mut core::fmt::Formatter<'_>,1665) -> core::fmt::Result {1666match self {1667OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),1668OtherVariant::B(e) => {1669f.debug_tuple("OtherVariant::B").field(e).finish()1670}1671OtherVariant::C(e) => {1672f.debug_tuple("OtherVariant::C").field(e).finish()1673}1674}1675}1676}1677const _: () = {1678assert!(167912 == < OtherVariant as wasmtime::component::ComponentType1680>::SIZE321681);1682assert!(16834 == < OtherVariant as wasmtime::component::ComponentType1684>::ALIGN321685);1686};1687#[derive(wasmtime::component::ComponentType)]1688#[derive(wasmtime::component::Lift)]1689#[derive(wasmtime::component::Lower)]1690#[component(variant)]1691#[derive(Clone)]1692pub enum SomeVariant {1693#[component(name = "a")]1694A(wasmtime::component::__internal::String),1695#[component(name = "b")]1696B,1697#[component(name = "c")]1698C(u32),1699#[component(name = "d")]1700D(wasmtime::component::__internal::Vec<OtherVariant>),1701}1702impl core::fmt::Debug for SomeVariant {1703fn fmt(1704&self,1705f: &mut core::fmt::Formatter<'_>,1706) -> core::fmt::Result {1707match self {1708SomeVariant::A(e) => {1709f.debug_tuple("SomeVariant::A").field(e).finish()1710}1711SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),1712SomeVariant::C(e) => {1713f.debug_tuple("SomeVariant::C").field(e).finish()1714}1715SomeVariant::D(e) => {1716f.debug_tuple("SomeVariant::D").field(e).finish()1717}1718}1719}1720}1721const _: () = {1722assert!(172312 == < SomeVariant as wasmtime::component::ComponentType1724>::SIZE321725);1726assert!(17274 == < SomeVariant as wasmtime::component::ComponentType1728>::ALIGN321729);1730};1731pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<1732(1733wasmtime::component::__internal::String,1734u8,1735i8,1736u16,1737i16,1738u32,1739i32,1740u64,1741i64,1742f32,1743f64,1744char,1745),1746>;1747const _: () = {1748assert!(17498 == < LoadStoreAllSizes as wasmtime::component::ComponentType1750>::SIZE321751);1752assert!(17534 == < LoadStoreAllSizes as wasmtime::component::ComponentType1754>::ALIGN321755);1756};1757pub struct Guest {1758list_u8_param: wasmtime::component::Func,1759list_u16_param: wasmtime::component::Func,1760list_u32_param: wasmtime::component::Func,1761list_u64_param: wasmtime::component::Func,1762list_s8_param: wasmtime::component::Func,1763list_s16_param: wasmtime::component::Func,1764list_s32_param: wasmtime::component::Func,1765list_s64_param: wasmtime::component::Func,1766list_f32_param: wasmtime::component::Func,1767list_f64_param: wasmtime::component::Func,1768list_u8_ret: wasmtime::component::Func,1769list_u16_ret: wasmtime::component::Func,1770list_u32_ret: wasmtime::component::Func,1771list_u64_ret: wasmtime::component::Func,1772list_s8_ret: wasmtime::component::Func,1773list_s16_ret: wasmtime::component::Func,1774list_s32_ret: wasmtime::component::Func,1775list_s64_ret: wasmtime::component::Func,1776list_f32_ret: wasmtime::component::Func,1777list_f64_ret: wasmtime::component::Func,1778tuple_list: wasmtime::component::Func,1779string_list_arg: wasmtime::component::Func,1780string_list_ret: wasmtime::component::Func,1781tuple_string_list: wasmtime::component::Func,1782string_list: wasmtime::component::Func,1783record_list: wasmtime::component::Func,1784record_list_reverse: wasmtime::component::Func,1785variant_list: wasmtime::component::Func,1786load_store_everything: wasmtime::component::Func,1787}1788#[derive(Clone)]1789pub struct GuestIndices {1790list_u8_param: wasmtime::component::ComponentExportIndex,1791list_u16_param: wasmtime::component::ComponentExportIndex,1792list_u32_param: wasmtime::component::ComponentExportIndex,1793list_u64_param: wasmtime::component::ComponentExportIndex,1794list_s8_param: wasmtime::component::ComponentExportIndex,1795list_s16_param: wasmtime::component::ComponentExportIndex,1796list_s32_param: wasmtime::component::ComponentExportIndex,1797list_s64_param: wasmtime::component::ComponentExportIndex,1798list_f32_param: wasmtime::component::ComponentExportIndex,1799list_f64_param: wasmtime::component::ComponentExportIndex,1800list_u8_ret: wasmtime::component::ComponentExportIndex,1801list_u16_ret: wasmtime::component::ComponentExportIndex,1802list_u32_ret: wasmtime::component::ComponentExportIndex,1803list_u64_ret: wasmtime::component::ComponentExportIndex,1804list_s8_ret: wasmtime::component::ComponentExportIndex,1805list_s16_ret: wasmtime::component::ComponentExportIndex,1806list_s32_ret: wasmtime::component::ComponentExportIndex,1807list_s64_ret: wasmtime::component::ComponentExportIndex,1808list_f32_ret: wasmtime::component::ComponentExportIndex,1809list_f64_ret: wasmtime::component::ComponentExportIndex,1810tuple_list: wasmtime::component::ComponentExportIndex,1811string_list_arg: wasmtime::component::ComponentExportIndex,1812string_list_ret: wasmtime::component::ComponentExportIndex,1813tuple_string_list: wasmtime::component::ComponentExportIndex,1814string_list: wasmtime::component::ComponentExportIndex,1815record_list: wasmtime::component::ComponentExportIndex,1816record_list_reverse: wasmtime::component::ComponentExportIndex,1817variant_list: wasmtime::component::ComponentExportIndex,1818load_store_everything: wasmtime::component::ComponentExportIndex,1819}1820impl GuestIndices {1821/// Constructor for [`GuestIndices`] which takes a1822/// [`Component`](wasmtime::component::Component) as input and can be executed1823/// before instantiation.1824///1825/// This constructor can be used to front-load string lookups to find exports1826/// within a component.1827pub fn new<_T>(1828_instance_pre: &wasmtime::component::InstancePre<_T>,1829) -> wasmtime::Result<GuestIndices> {1830let instance = _instance_pre1831.component()1832.get_export_index(None, "foo:foo/lists")1833.ok_or_else(|| {1834anyhow::anyhow!(1835"no exported instance named `foo:foo/lists`"1836)1837})?;1838let mut lookup = move |name| {1839_instance_pre1840.component()1841.get_export_index(Some(&instance), name)1842.ok_or_else(|| {1843anyhow::anyhow!(1844"instance export `foo:foo/lists` does \1845not have export `{name}`"1846)1847})1848};1849let _ = &mut lookup;1850let list_u8_param = lookup("list-u8-param")?;1851let list_u16_param = lookup("list-u16-param")?;1852let list_u32_param = lookup("list-u32-param")?;1853let list_u64_param = lookup("list-u64-param")?;1854let list_s8_param = lookup("list-s8-param")?;1855let list_s16_param = lookup("list-s16-param")?;1856let list_s32_param = lookup("list-s32-param")?;1857let list_s64_param = lookup("list-s64-param")?;1858let list_f32_param = lookup("list-f32-param")?;1859let list_f64_param = lookup("list-f64-param")?;1860let list_u8_ret = lookup("list-u8-ret")?;1861let list_u16_ret = lookup("list-u16-ret")?;1862let list_u32_ret = lookup("list-u32-ret")?;1863let list_u64_ret = lookup("list-u64-ret")?;1864let list_s8_ret = lookup("list-s8-ret")?;1865let list_s16_ret = lookup("list-s16-ret")?;1866let list_s32_ret = lookup("list-s32-ret")?;1867let list_s64_ret = lookup("list-s64-ret")?;1868let list_f32_ret = lookup("list-f32-ret")?;1869let list_f64_ret = lookup("list-f64-ret")?;1870let tuple_list = lookup("tuple-list")?;1871let string_list_arg = lookup("string-list-arg")?;1872let string_list_ret = lookup("string-list-ret")?;1873let tuple_string_list = lookup("tuple-string-list")?;1874let string_list = lookup("string-list")?;1875let record_list = lookup("record-list")?;1876let record_list_reverse = lookup("record-list-reverse")?;1877let variant_list = lookup("variant-list")?;1878let load_store_everything = lookup("load-store-everything")?;1879Ok(GuestIndices {1880list_u8_param,1881list_u16_param,1882list_u32_param,1883list_u64_param,1884list_s8_param,1885list_s16_param,1886list_s32_param,1887list_s64_param,1888list_f32_param,1889list_f64_param,1890list_u8_ret,1891list_u16_ret,1892list_u32_ret,1893list_u64_ret,1894list_s8_ret,1895list_s16_ret,1896list_s32_ret,1897list_s64_ret,1898list_f32_ret,1899list_f64_ret,1900tuple_list,1901string_list_arg,1902string_list_ret,1903tuple_string_list,1904string_list,1905record_list,1906record_list_reverse,1907variant_list,1908load_store_everything,1909})1910}1911pub fn load(1912&self,1913mut store: impl wasmtime::AsContextMut,1914instance: &wasmtime::component::Instance,1915) -> wasmtime::Result<Guest> {1916let _instance = instance;1917let _instance_pre = _instance.instance_pre(&store);1918let _instance_type = _instance_pre.instance_type();1919let mut store = store.as_context_mut();1920let _ = &mut store;1921let list_u8_param = *_instance1922.get_typed_func::<1923(&[u8],),1924(),1925>(&mut store, &self.list_u8_param)?1926.func();1927let list_u16_param = *_instance1928.get_typed_func::<1929(&[u16],),1930(),1931>(&mut store, &self.list_u16_param)?1932.func();1933let list_u32_param = *_instance1934.get_typed_func::<1935(&[u32],),1936(),1937>(&mut store, &self.list_u32_param)?1938.func();1939let list_u64_param = *_instance1940.get_typed_func::<1941(&[u64],),1942(),1943>(&mut store, &self.list_u64_param)?1944.func();1945let list_s8_param = *_instance1946.get_typed_func::<1947(&[i8],),1948(),1949>(&mut store, &self.list_s8_param)?1950.func();1951let list_s16_param = *_instance1952.get_typed_func::<1953(&[i16],),1954(),1955>(&mut store, &self.list_s16_param)?1956.func();1957let list_s32_param = *_instance1958.get_typed_func::<1959(&[i32],),1960(),1961>(&mut store, &self.list_s32_param)?1962.func();1963let list_s64_param = *_instance1964.get_typed_func::<1965(&[i64],),1966(),1967>(&mut store, &self.list_s64_param)?1968.func();1969let list_f32_param = *_instance1970.get_typed_func::<1971(&[f32],),1972(),1973>(&mut store, &self.list_f32_param)?1974.func();1975let list_f64_param = *_instance1976.get_typed_func::<1977(&[f64],),1978(),1979>(&mut store, &self.list_f64_param)?1980.func();1981let list_u8_ret = *_instance1982.get_typed_func::<1983(),1984(wasmtime::component::__internal::Vec<u8>,),1985>(&mut store, &self.list_u8_ret)?1986.func();1987let list_u16_ret = *_instance1988.get_typed_func::<1989(),1990(wasmtime::component::__internal::Vec<u16>,),1991>(&mut store, &self.list_u16_ret)?1992.func();1993let list_u32_ret = *_instance1994.get_typed_func::<1995(),1996(wasmtime::component::__internal::Vec<u32>,),1997>(&mut store, &self.list_u32_ret)?1998.func();1999let list_u64_ret = *_instance2000.get_typed_func::<2001(),2002(wasmtime::component::__internal::Vec<u64>,),2003>(&mut store, &self.list_u64_ret)?2004.func();2005let list_s8_ret = *_instance2006.get_typed_func::<2007(),2008(wasmtime::component::__internal::Vec<i8>,),2009>(&mut store, &self.list_s8_ret)?2010.func();2011let list_s16_ret = *_instance2012.get_typed_func::<2013(),2014(wasmtime::component::__internal::Vec<i16>,),2015>(&mut store, &self.list_s16_ret)?2016.func();2017let list_s32_ret = *_instance2018.get_typed_func::<2019(),2020(wasmtime::component::__internal::Vec<i32>,),2021>(&mut store, &self.list_s32_ret)?2022.func();2023let list_s64_ret = *_instance2024.get_typed_func::<2025(),2026(wasmtime::component::__internal::Vec<i64>,),2027>(&mut store, &self.list_s64_ret)?2028.func();2029let list_f32_ret = *_instance2030.get_typed_func::<2031(),2032(wasmtime::component::__internal::Vec<f32>,),2033>(&mut store, &self.list_f32_ret)?2034.func();2035let list_f64_ret = *_instance2036.get_typed_func::<2037(),2038(wasmtime::component::__internal::Vec<f64>,),2039>(&mut store, &self.list_f64_ret)?2040.func();2041let tuple_list = *_instance2042.get_typed_func::<2043(&[(u8, i8)],),2044(wasmtime::component::__internal::Vec<(i64, u32)>,),2045>(&mut store, &self.tuple_list)?2046.func();2047let string_list_arg = *_instance2048.get_typed_func::<2049(&[wasmtime::component::__internal::String],),2050(),2051>(&mut store, &self.string_list_arg)?2052.func();2053let string_list_ret = *_instance2054.get_typed_func::<2055(),2056(2057wasmtime::component::__internal::Vec<2058wasmtime::component::__internal::String,2059>,2060),2061>(&mut store, &self.string_list_ret)?2062.func();2063let tuple_string_list = *_instance2064.get_typed_func::<2065(&[(u8, wasmtime::component::__internal::String)],),2066(2067wasmtime::component::__internal::Vec<2068(wasmtime::component::__internal::String, u8),2069>,2070),2071>(&mut store, &self.tuple_string_list)?2072.func();2073let string_list = *_instance2074.get_typed_func::<2075(&[wasmtime::component::__internal::String],),2076(2077wasmtime::component::__internal::Vec<2078wasmtime::component::__internal::String,2079>,2080),2081>(&mut store, &self.string_list)?2082.func();2083let record_list = *_instance2084.get_typed_func::<2085(&[SomeRecord],),2086(wasmtime::component::__internal::Vec<OtherRecord>,),2087>(&mut store, &self.record_list)?2088.func();2089let record_list_reverse = *_instance2090.get_typed_func::<2091(&[OtherRecord],),2092(wasmtime::component::__internal::Vec<SomeRecord>,),2093>(&mut store, &self.record_list_reverse)?2094.func();2095let variant_list = *_instance2096.get_typed_func::<2097(&[SomeVariant],),2098(wasmtime::component::__internal::Vec<OtherVariant>,),2099>(&mut store, &self.variant_list)?2100.func();2101let load_store_everything = *_instance2102.get_typed_func::<2103(&LoadStoreAllSizes,),2104(LoadStoreAllSizes,),2105>(&mut store, &self.load_store_everything)?2106.func();2107Ok(Guest {2108list_u8_param,2109list_u16_param,2110list_u32_param,2111list_u64_param,2112list_s8_param,2113list_s16_param,2114list_s32_param,2115list_s64_param,2116list_f32_param,2117list_f64_param,2118list_u8_ret,2119list_u16_ret,2120list_u32_ret,2121list_u64_ret,2122list_s8_ret,2123list_s16_ret,2124list_s32_ret,2125list_s64_ret,2126list_f32_ret,2127list_f64_ret,2128tuple_list,2129string_list_arg,2130string_list_ret,2131tuple_string_list,2132string_list,2133record_list,2134record_list_reverse,2135variant_list,2136load_store_everything,2137})2138}2139}2140impl Guest {2141pub async fn call_list_u8_param<S: wasmtime::AsContextMut>(2142&self,2143mut store: S,2144arg0: &[u8],2145) -> wasmtime::Result<()>2146where2147<S as wasmtime::AsContext>::Data: Send,2148{2149use tracing::Instrument;2150let span = tracing::span!(2151tracing::Level::TRACE, "wit-bindgen export", module =2152"foo:foo/lists", function = "list-u8-param",2153);2154let callee = unsafe {2155wasmtime::component::TypedFunc::<2156(&[u8],),2157(),2158>::new_unchecked(self.list_u8_param)2159};2160let () = callee2161.call_async(store.as_context_mut(), (arg0,))2162.instrument(span.clone())2163.await?;2164callee2165.post_return_async(store.as_context_mut())2166.instrument(span)2167.await?;2168Ok(())2169}2170pub async fn call_list_u16_param<S: wasmtime::AsContextMut>(2171&self,2172mut store: S,2173arg0: &[u16],2174) -> wasmtime::Result<()>2175where2176<S as wasmtime::AsContext>::Data: Send,2177{2178use tracing::Instrument;2179let span = tracing::span!(2180tracing::Level::TRACE, "wit-bindgen export", module =2181"foo:foo/lists", function = "list-u16-param",2182);2183let callee = unsafe {2184wasmtime::component::TypedFunc::<2185(&[u16],),2186(),2187>::new_unchecked(self.list_u16_param)2188};2189let () = callee2190.call_async(store.as_context_mut(), (arg0,))2191.instrument(span.clone())2192.await?;2193callee2194.post_return_async(store.as_context_mut())2195.instrument(span)2196.await?;2197Ok(())2198}2199pub async fn call_list_u32_param<S: wasmtime::AsContextMut>(2200&self,2201mut store: S,2202arg0: &[u32],2203) -> wasmtime::Result<()>2204where2205<S as wasmtime::AsContext>::Data: Send,2206{2207use tracing::Instrument;2208let span = tracing::span!(2209tracing::Level::TRACE, "wit-bindgen export", module =2210"foo:foo/lists", function = "list-u32-param",2211);2212let callee = unsafe {2213wasmtime::component::TypedFunc::<2214(&[u32],),2215(),2216>::new_unchecked(self.list_u32_param)2217};2218let () = callee2219.call_async(store.as_context_mut(), (arg0,))2220.instrument(span.clone())2221.await?;2222callee2223.post_return_async(store.as_context_mut())2224.instrument(span)2225.await?;2226Ok(())2227}2228pub async fn call_list_u64_param<S: wasmtime::AsContextMut>(2229&self,2230mut store: S,2231arg0: &[u64],2232) -> wasmtime::Result<()>2233where2234<S as wasmtime::AsContext>::Data: Send,2235{2236use tracing::Instrument;2237let span = tracing::span!(2238tracing::Level::TRACE, "wit-bindgen export", module =2239"foo:foo/lists", function = "list-u64-param",2240);2241let callee = unsafe {2242wasmtime::component::TypedFunc::<2243(&[u64],),2244(),2245>::new_unchecked(self.list_u64_param)2246};2247let () = callee2248.call_async(store.as_context_mut(), (arg0,))2249.instrument(span.clone())2250.await?;2251callee2252.post_return_async(store.as_context_mut())2253.instrument(span)2254.await?;2255Ok(())2256}2257pub async fn call_list_s8_param<S: wasmtime::AsContextMut>(2258&self,2259mut store: S,2260arg0: &[i8],2261) -> wasmtime::Result<()>2262where2263<S as wasmtime::AsContext>::Data: Send,2264{2265use tracing::Instrument;2266let span = tracing::span!(2267tracing::Level::TRACE, "wit-bindgen export", module =2268"foo:foo/lists", function = "list-s8-param",2269);2270let callee = unsafe {2271wasmtime::component::TypedFunc::<2272(&[i8],),2273(),2274>::new_unchecked(self.list_s8_param)2275};2276let () = callee2277.call_async(store.as_context_mut(), (arg0,))2278.instrument(span.clone())2279.await?;2280callee2281.post_return_async(store.as_context_mut())2282.instrument(span)2283.await?;2284Ok(())2285}2286pub async fn call_list_s16_param<S: wasmtime::AsContextMut>(2287&self,2288mut store: S,2289arg0: &[i16],2290) -> wasmtime::Result<()>2291where2292<S as wasmtime::AsContext>::Data: Send,2293{2294use tracing::Instrument;2295let span = tracing::span!(2296tracing::Level::TRACE, "wit-bindgen export", module =2297"foo:foo/lists", function = "list-s16-param",2298);2299let callee = unsafe {2300wasmtime::component::TypedFunc::<2301(&[i16],),2302(),2303>::new_unchecked(self.list_s16_param)2304};2305let () = callee2306.call_async(store.as_context_mut(), (arg0,))2307.instrument(span.clone())2308.await?;2309callee2310.post_return_async(store.as_context_mut())2311.instrument(span)2312.await?;2313Ok(())2314}2315pub async fn call_list_s32_param<S: wasmtime::AsContextMut>(2316&self,2317mut store: S,2318arg0: &[i32],2319) -> wasmtime::Result<()>2320where2321<S as wasmtime::AsContext>::Data: Send,2322{2323use tracing::Instrument;2324let span = tracing::span!(2325tracing::Level::TRACE, "wit-bindgen export", module =2326"foo:foo/lists", function = "list-s32-param",2327);2328let callee = unsafe {2329wasmtime::component::TypedFunc::<2330(&[i32],),2331(),2332>::new_unchecked(self.list_s32_param)2333};2334let () = callee2335.call_async(store.as_context_mut(), (arg0,))2336.instrument(span.clone())2337.await?;2338callee2339.post_return_async(store.as_context_mut())2340.instrument(span)2341.await?;2342Ok(())2343}2344pub async fn call_list_s64_param<S: wasmtime::AsContextMut>(2345&self,2346mut store: S,2347arg0: &[i64],2348) -> wasmtime::Result<()>2349where2350<S as wasmtime::AsContext>::Data: Send,2351{2352use tracing::Instrument;2353let span = tracing::span!(2354tracing::Level::TRACE, "wit-bindgen export", module =2355"foo:foo/lists", function = "list-s64-param",2356);2357let callee = unsafe {2358wasmtime::component::TypedFunc::<2359(&[i64],),2360(),2361>::new_unchecked(self.list_s64_param)2362};2363let () = callee2364.call_async(store.as_context_mut(), (arg0,))2365.instrument(span.clone())2366.await?;2367callee2368.post_return_async(store.as_context_mut())2369.instrument(span)2370.await?;2371Ok(())2372}2373pub async fn call_list_f32_param<S: wasmtime::AsContextMut>(2374&self,2375mut store: S,2376arg0: &[f32],2377) -> wasmtime::Result<()>2378where2379<S as wasmtime::AsContext>::Data: Send,2380{2381use tracing::Instrument;2382let span = tracing::span!(2383tracing::Level::TRACE, "wit-bindgen export", module =2384"foo:foo/lists", function = "list-f32-param",2385);2386let callee = unsafe {2387wasmtime::component::TypedFunc::<2388(&[f32],),2389(),2390>::new_unchecked(self.list_f32_param)2391};2392let () = callee2393.call_async(store.as_context_mut(), (arg0,))2394.instrument(span.clone())2395.await?;2396callee2397.post_return_async(store.as_context_mut())2398.instrument(span)2399.await?;2400Ok(())2401}2402pub async fn call_list_f64_param<S: wasmtime::AsContextMut>(2403&self,2404mut store: S,2405arg0: &[f64],2406) -> wasmtime::Result<()>2407where2408<S as wasmtime::AsContext>::Data: Send,2409{2410use tracing::Instrument;2411let span = tracing::span!(2412tracing::Level::TRACE, "wit-bindgen export", module =2413"foo:foo/lists", function = "list-f64-param",2414);2415let callee = unsafe {2416wasmtime::component::TypedFunc::<2417(&[f64],),2418(),2419>::new_unchecked(self.list_f64_param)2420};2421let () = callee2422.call_async(store.as_context_mut(), (arg0,))2423.instrument(span.clone())2424.await?;2425callee2426.post_return_async(store.as_context_mut())2427.instrument(span)2428.await?;2429Ok(())2430}2431pub async fn call_list_u8_ret<S: wasmtime::AsContextMut>(2432&self,2433mut store: S,2434) -> wasmtime::Result<wasmtime::component::__internal::Vec<u8>>2435where2436<S as wasmtime::AsContext>::Data: Send,2437{2438use tracing::Instrument;2439let span = tracing::span!(2440tracing::Level::TRACE, "wit-bindgen export", module =2441"foo:foo/lists", function = "list-u8-ret",2442);2443let callee = unsafe {2444wasmtime::component::TypedFunc::<2445(),2446(wasmtime::component::__internal::Vec<u8>,),2447>::new_unchecked(self.list_u8_ret)2448};2449let (ret0,) = callee2450.call_async(store.as_context_mut(), ())2451.instrument(span.clone())2452.await?;2453callee2454.post_return_async(store.as_context_mut())2455.instrument(span)2456.await?;2457Ok(ret0)2458}2459pub async fn call_list_u16_ret<S: wasmtime::AsContextMut>(2460&self,2461mut store: S,2462) -> wasmtime::Result<wasmtime::component::__internal::Vec<u16>>2463where2464<S as wasmtime::AsContext>::Data: Send,2465{2466use tracing::Instrument;2467let span = tracing::span!(2468tracing::Level::TRACE, "wit-bindgen export", module =2469"foo:foo/lists", function = "list-u16-ret",2470);2471let callee = unsafe {2472wasmtime::component::TypedFunc::<2473(),2474(wasmtime::component::__internal::Vec<u16>,),2475>::new_unchecked(self.list_u16_ret)2476};2477let (ret0,) = callee2478.call_async(store.as_context_mut(), ())2479.instrument(span.clone())2480.await?;2481callee2482.post_return_async(store.as_context_mut())2483.instrument(span)2484.await?;2485Ok(ret0)2486}2487pub async fn call_list_u32_ret<S: wasmtime::AsContextMut>(2488&self,2489mut store: S,2490) -> wasmtime::Result<wasmtime::component::__internal::Vec<u32>>2491where2492<S as wasmtime::AsContext>::Data: Send,2493{2494use tracing::Instrument;2495let span = tracing::span!(2496tracing::Level::TRACE, "wit-bindgen export", module =2497"foo:foo/lists", function = "list-u32-ret",2498);2499let callee = unsafe {2500wasmtime::component::TypedFunc::<2501(),2502(wasmtime::component::__internal::Vec<u32>,),2503>::new_unchecked(self.list_u32_ret)2504};2505let (ret0,) = callee2506.call_async(store.as_context_mut(), ())2507.instrument(span.clone())2508.await?;2509callee2510.post_return_async(store.as_context_mut())2511.instrument(span)2512.await?;2513Ok(ret0)2514}2515pub async fn call_list_u64_ret<S: wasmtime::AsContextMut>(2516&self,2517mut store: S,2518) -> wasmtime::Result<wasmtime::component::__internal::Vec<u64>>2519where2520<S as wasmtime::AsContext>::Data: Send,2521{2522use tracing::Instrument;2523let span = tracing::span!(2524tracing::Level::TRACE, "wit-bindgen export", module =2525"foo:foo/lists", function = "list-u64-ret",2526);2527let callee = unsafe {2528wasmtime::component::TypedFunc::<2529(),2530(wasmtime::component::__internal::Vec<u64>,),2531>::new_unchecked(self.list_u64_ret)2532};2533let (ret0,) = callee2534.call_async(store.as_context_mut(), ())2535.instrument(span.clone())2536.await?;2537callee2538.post_return_async(store.as_context_mut())2539.instrument(span)2540.await?;2541Ok(ret0)2542}2543pub async fn call_list_s8_ret<S: wasmtime::AsContextMut>(2544&self,2545mut store: S,2546) -> wasmtime::Result<wasmtime::component::__internal::Vec<i8>>2547where2548<S as wasmtime::AsContext>::Data: Send,2549{2550use tracing::Instrument;2551let span = tracing::span!(2552tracing::Level::TRACE, "wit-bindgen export", module =2553"foo:foo/lists", function = "list-s8-ret",2554);2555let callee = unsafe {2556wasmtime::component::TypedFunc::<2557(),2558(wasmtime::component::__internal::Vec<i8>,),2559>::new_unchecked(self.list_s8_ret)2560};2561let (ret0,) = callee2562.call_async(store.as_context_mut(), ())2563.instrument(span.clone())2564.await?;2565callee2566.post_return_async(store.as_context_mut())2567.instrument(span)2568.await?;2569Ok(ret0)2570}2571pub async fn call_list_s16_ret<S: wasmtime::AsContextMut>(2572&self,2573mut store: S,2574) -> wasmtime::Result<wasmtime::component::__internal::Vec<i16>>2575where2576<S as wasmtime::AsContext>::Data: Send,2577{2578use tracing::Instrument;2579let span = tracing::span!(2580tracing::Level::TRACE, "wit-bindgen export", module =2581"foo:foo/lists", function = "list-s16-ret",2582);2583let callee = unsafe {2584wasmtime::component::TypedFunc::<2585(),2586(wasmtime::component::__internal::Vec<i16>,),2587>::new_unchecked(self.list_s16_ret)2588};2589let (ret0,) = callee2590.call_async(store.as_context_mut(), ())2591.instrument(span.clone())2592.await?;2593callee2594.post_return_async(store.as_context_mut())2595.instrument(span)2596.await?;2597Ok(ret0)2598}2599pub async fn call_list_s32_ret<S: wasmtime::AsContextMut>(2600&self,2601mut store: S,2602) -> wasmtime::Result<wasmtime::component::__internal::Vec<i32>>2603where2604<S as wasmtime::AsContext>::Data: Send,2605{2606use tracing::Instrument;2607let span = tracing::span!(2608tracing::Level::TRACE, "wit-bindgen export", module =2609"foo:foo/lists", function = "list-s32-ret",2610);2611let callee = unsafe {2612wasmtime::component::TypedFunc::<2613(),2614(wasmtime::component::__internal::Vec<i32>,),2615>::new_unchecked(self.list_s32_ret)2616};2617let (ret0,) = callee2618.call_async(store.as_context_mut(), ())2619.instrument(span.clone())2620.await?;2621callee2622.post_return_async(store.as_context_mut())2623.instrument(span)2624.await?;2625Ok(ret0)2626}2627pub async fn call_list_s64_ret<S: wasmtime::AsContextMut>(2628&self,2629mut store: S,2630) -> wasmtime::Result<wasmtime::component::__internal::Vec<i64>>2631where2632<S as wasmtime::AsContext>::Data: Send,2633{2634use tracing::Instrument;2635let span = tracing::span!(2636tracing::Level::TRACE, "wit-bindgen export", module =2637"foo:foo/lists", function = "list-s64-ret",2638);2639let callee = unsafe {2640wasmtime::component::TypedFunc::<2641(),2642(wasmtime::component::__internal::Vec<i64>,),2643>::new_unchecked(self.list_s64_ret)2644};2645let (ret0,) = callee2646.call_async(store.as_context_mut(), ())2647.instrument(span.clone())2648.await?;2649callee2650.post_return_async(store.as_context_mut())2651.instrument(span)2652.await?;2653Ok(ret0)2654}2655pub async fn call_list_f32_ret<S: wasmtime::AsContextMut>(2656&self,2657mut store: S,2658) -> wasmtime::Result<wasmtime::component::__internal::Vec<f32>>2659where2660<S as wasmtime::AsContext>::Data: Send,2661{2662use tracing::Instrument;2663let span = tracing::span!(2664tracing::Level::TRACE, "wit-bindgen export", module =2665"foo:foo/lists", function = "list-f32-ret",2666);2667let callee = unsafe {2668wasmtime::component::TypedFunc::<2669(),2670(wasmtime::component::__internal::Vec<f32>,),2671>::new_unchecked(self.list_f32_ret)2672};2673let (ret0,) = callee2674.call_async(store.as_context_mut(), ())2675.instrument(span.clone())2676.await?;2677callee2678.post_return_async(store.as_context_mut())2679.instrument(span)2680.await?;2681Ok(ret0)2682}2683pub async fn call_list_f64_ret<S: wasmtime::AsContextMut>(2684&self,2685mut store: S,2686) -> wasmtime::Result<wasmtime::component::__internal::Vec<f64>>2687where2688<S as wasmtime::AsContext>::Data: Send,2689{2690use tracing::Instrument;2691let span = tracing::span!(2692tracing::Level::TRACE, "wit-bindgen export", module =2693"foo:foo/lists", function = "list-f64-ret",2694);2695let callee = unsafe {2696wasmtime::component::TypedFunc::<2697(),2698(wasmtime::component::__internal::Vec<f64>,),2699>::new_unchecked(self.list_f64_ret)2700};2701let (ret0,) = callee2702.call_async(store.as_context_mut(), ())2703.instrument(span.clone())2704.await?;2705callee2706.post_return_async(store.as_context_mut())2707.instrument(span)2708.await?;2709Ok(ret0)2710}2711pub async fn call_tuple_list<S: wasmtime::AsContextMut>(2712&self,2713mut store: S,2714arg0: &[(u8, i8)],2715) -> wasmtime::Result<2716wasmtime::component::__internal::Vec<(i64, u32)>,2717>2718where2719<S as wasmtime::AsContext>::Data: Send,2720{2721use tracing::Instrument;2722let span = tracing::span!(2723tracing::Level::TRACE, "wit-bindgen export", module =2724"foo:foo/lists", function = "tuple-list",2725);2726let callee = unsafe {2727wasmtime::component::TypedFunc::<2728(&[(u8, i8)],),2729(wasmtime::component::__internal::Vec<(i64, u32)>,),2730>::new_unchecked(self.tuple_list)2731};2732let (ret0,) = callee2733.call_async(store.as_context_mut(), (arg0,))2734.instrument(span.clone())2735.await?;2736callee2737.post_return_async(store.as_context_mut())2738.instrument(span)2739.await?;2740Ok(ret0)2741}2742pub async fn call_string_list_arg<S: wasmtime::AsContextMut>(2743&self,2744mut store: S,2745arg0: &[wasmtime::component::__internal::String],2746) -> wasmtime::Result<()>2747where2748<S as wasmtime::AsContext>::Data: Send,2749{2750use tracing::Instrument;2751let span = tracing::span!(2752tracing::Level::TRACE, "wit-bindgen export", module =2753"foo:foo/lists", function = "string-list-arg",2754);2755let callee = unsafe {2756wasmtime::component::TypedFunc::<2757(&[wasmtime::component::__internal::String],),2758(),2759>::new_unchecked(self.string_list_arg)2760};2761let () = callee2762.call_async(store.as_context_mut(), (arg0,))2763.instrument(span.clone())2764.await?;2765callee2766.post_return_async(store.as_context_mut())2767.instrument(span)2768.await?;2769Ok(())2770}2771pub async fn call_string_list_ret<S: wasmtime::AsContextMut>(2772&self,2773mut store: S,2774) -> wasmtime::Result<2775wasmtime::component::__internal::Vec<2776wasmtime::component::__internal::String,2777>,2778>2779where2780<S as wasmtime::AsContext>::Data: Send,2781{2782use tracing::Instrument;2783let span = tracing::span!(2784tracing::Level::TRACE, "wit-bindgen export", module =2785"foo:foo/lists", function = "string-list-ret",2786);2787let callee = unsafe {2788wasmtime::component::TypedFunc::<2789(),2790(2791wasmtime::component::__internal::Vec<2792wasmtime::component::__internal::String,2793>,2794),2795>::new_unchecked(self.string_list_ret)2796};2797let (ret0,) = callee2798.call_async(store.as_context_mut(), ())2799.instrument(span.clone())2800.await?;2801callee2802.post_return_async(store.as_context_mut())2803.instrument(span)2804.await?;2805Ok(ret0)2806}2807pub async fn call_tuple_string_list<S: wasmtime::AsContextMut>(2808&self,2809mut store: S,2810arg0: &[(u8, wasmtime::component::__internal::String)],2811) -> wasmtime::Result<2812wasmtime::component::__internal::Vec<2813(wasmtime::component::__internal::String, u8),2814>,2815>2816where2817<S as wasmtime::AsContext>::Data: Send,2818{2819use tracing::Instrument;2820let span = tracing::span!(2821tracing::Level::TRACE, "wit-bindgen export", module =2822"foo:foo/lists", function = "tuple-string-list",2823);2824let callee = unsafe {2825wasmtime::component::TypedFunc::<2826(&[(u8, wasmtime::component::__internal::String)],),2827(2828wasmtime::component::__internal::Vec<2829(wasmtime::component::__internal::String, u8),2830>,2831),2832>::new_unchecked(self.tuple_string_list)2833};2834let (ret0,) = callee2835.call_async(store.as_context_mut(), (arg0,))2836.instrument(span.clone())2837.await?;2838callee2839.post_return_async(store.as_context_mut())2840.instrument(span)2841.await?;2842Ok(ret0)2843}2844pub async fn call_string_list<S: wasmtime::AsContextMut>(2845&self,2846mut store: S,2847arg0: &[wasmtime::component::__internal::String],2848) -> wasmtime::Result<2849wasmtime::component::__internal::Vec<2850wasmtime::component::__internal::String,2851>,2852>2853where2854<S as wasmtime::AsContext>::Data: Send,2855{2856use tracing::Instrument;2857let span = tracing::span!(2858tracing::Level::TRACE, "wit-bindgen export", module =2859"foo:foo/lists", function = "string-list",2860);2861let callee = unsafe {2862wasmtime::component::TypedFunc::<2863(&[wasmtime::component::__internal::String],),2864(2865wasmtime::component::__internal::Vec<2866wasmtime::component::__internal::String,2867>,2868),2869>::new_unchecked(self.string_list)2870};2871let (ret0,) = callee2872.call_async(store.as_context_mut(), (arg0,))2873.instrument(span.clone())2874.await?;2875callee2876.post_return_async(store.as_context_mut())2877.instrument(span)2878.await?;2879Ok(ret0)2880}2881pub async fn call_record_list<S: wasmtime::AsContextMut>(2882&self,2883mut store: S,2884arg0: &[SomeRecord],2885) -> wasmtime::Result<2886wasmtime::component::__internal::Vec<OtherRecord>,2887>2888where2889<S as wasmtime::AsContext>::Data: Send,2890{2891use tracing::Instrument;2892let span = tracing::span!(2893tracing::Level::TRACE, "wit-bindgen export", module =2894"foo:foo/lists", function = "record-list",2895);2896let callee = unsafe {2897wasmtime::component::TypedFunc::<2898(&[SomeRecord],),2899(wasmtime::component::__internal::Vec<OtherRecord>,),2900>::new_unchecked(self.record_list)2901};2902let (ret0,) = callee2903.call_async(store.as_context_mut(), (arg0,))2904.instrument(span.clone())2905.await?;2906callee2907.post_return_async(store.as_context_mut())2908.instrument(span)2909.await?;2910Ok(ret0)2911}2912pub async fn call_record_list_reverse<S: wasmtime::AsContextMut>(2913&self,2914mut store: S,2915arg0: &[OtherRecord],2916) -> wasmtime::Result<2917wasmtime::component::__internal::Vec<SomeRecord>,2918>2919where2920<S as wasmtime::AsContext>::Data: Send,2921{2922use tracing::Instrument;2923let span = tracing::span!(2924tracing::Level::TRACE, "wit-bindgen export", module =2925"foo:foo/lists", function = "record-list-reverse",2926);2927let callee = unsafe {2928wasmtime::component::TypedFunc::<2929(&[OtherRecord],),2930(wasmtime::component::__internal::Vec<SomeRecord>,),2931>::new_unchecked(self.record_list_reverse)2932};2933let (ret0,) = callee2934.call_async(store.as_context_mut(), (arg0,))2935.instrument(span.clone())2936.await?;2937callee2938.post_return_async(store.as_context_mut())2939.instrument(span)2940.await?;2941Ok(ret0)2942}2943pub async fn call_variant_list<S: wasmtime::AsContextMut>(2944&self,2945mut store: S,2946arg0: &[SomeVariant],2947) -> wasmtime::Result<2948wasmtime::component::__internal::Vec<OtherVariant>,2949>2950where2951<S as wasmtime::AsContext>::Data: Send,2952{2953use tracing::Instrument;2954let span = tracing::span!(2955tracing::Level::TRACE, "wit-bindgen export", module =2956"foo:foo/lists", function = "variant-list",2957);2958let callee = unsafe {2959wasmtime::component::TypedFunc::<2960(&[SomeVariant],),2961(wasmtime::component::__internal::Vec<OtherVariant>,),2962>::new_unchecked(self.variant_list)2963};2964let (ret0,) = callee2965.call_async(store.as_context_mut(), (arg0,))2966.instrument(span.clone())2967.await?;2968callee2969.post_return_async(store.as_context_mut())2970.instrument(span)2971.await?;2972Ok(ret0)2973}2974pub async fn call_load_store_everything<S: wasmtime::AsContextMut>(2975&self,2976mut store: S,2977arg0: &LoadStoreAllSizes,2978) -> wasmtime::Result<LoadStoreAllSizes>2979where2980<S as wasmtime::AsContext>::Data: Send,2981{2982use tracing::Instrument;2983let span = tracing::span!(2984tracing::Level::TRACE, "wit-bindgen export", module =2985"foo:foo/lists", function = "load-store-everything",2986);2987let callee = unsafe {2988wasmtime::component::TypedFunc::<2989(&LoadStoreAllSizes,),2990(LoadStoreAllSizes,),2991>::new_unchecked(self.load_store_everything)2992};2993let (ret0,) = callee2994.call_async(store.as_context_mut(), (arg0,))2995.instrument(span.clone())2996.await?;2997callee2998.post_return_async(store.as_context_mut())2999.instrument(span)3000.await?;3001Ok(ret0)3002}3003}3004}3005}3006}3007}300830093010