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