Path: blob/main/crates/component-macro/tests/expanded/lists.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,176for<'a> D::Data<'a>: foo::foo::lists::Host,177T: 'static,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 {}374impl<_T: ?Sized> HostWithStore for _T375where376_T: wasmtime::component::HasData,377{}378pub trait Host {379fn list_u8_param(380&mut self,381x: wasmtime::component::__internal::Vec<u8>,382) -> ();383fn list_u16_param(384&mut self,385x: wasmtime::component::__internal::Vec<u16>,386) -> ();387fn list_u32_param(388&mut self,389x: wasmtime::component::__internal::Vec<u32>,390) -> ();391fn list_u64_param(392&mut self,393x: wasmtime::component::__internal::Vec<u64>,394) -> ();395fn list_s8_param(396&mut self,397x: wasmtime::component::__internal::Vec<i8>,398) -> ();399fn list_s16_param(400&mut self,401x: wasmtime::component::__internal::Vec<i16>,402) -> ();403fn list_s32_param(404&mut self,405x: wasmtime::component::__internal::Vec<i32>,406) -> ();407fn list_s64_param(408&mut self,409x: wasmtime::component::__internal::Vec<i64>,410) -> ();411fn list_f32_param(412&mut self,413x: wasmtime::component::__internal::Vec<f32>,414) -> ();415fn list_f64_param(416&mut self,417x: wasmtime::component::__internal::Vec<f64>,418) -> ();419fn list_u8_ret(&mut self) -> wasmtime::component::__internal::Vec<u8>;420fn list_u16_ret(&mut self) -> wasmtime::component::__internal::Vec<u16>;421fn list_u32_ret(&mut self) -> wasmtime::component::__internal::Vec<u32>;422fn list_u64_ret(&mut self) -> wasmtime::component::__internal::Vec<u64>;423fn list_s8_ret(&mut self) -> wasmtime::component::__internal::Vec<i8>;424fn list_s16_ret(&mut self) -> wasmtime::component::__internal::Vec<i16>;425fn list_s32_ret(&mut self) -> wasmtime::component::__internal::Vec<i32>;426fn list_s64_ret(&mut self) -> wasmtime::component::__internal::Vec<i64>;427fn list_f32_ret(&mut self) -> wasmtime::component::__internal::Vec<f32>;428fn list_f64_ret(&mut self) -> wasmtime::component::__internal::Vec<f64>;429fn tuple_list(430&mut self,431x: wasmtime::component::__internal::Vec<(u8, i8)>,432) -> wasmtime::component::__internal::Vec<(i64, u32)>;433fn string_list_arg(434&mut self,435a: wasmtime::component::__internal::Vec<436wasmtime::component::__internal::String,437>,438) -> ();439fn string_list_ret(440&mut self,441) -> wasmtime::component::__internal::Vec<442wasmtime::component::__internal::String,443>;444fn tuple_string_list(445&mut self,446x: wasmtime::component::__internal::Vec<447(u8, wasmtime::component::__internal::String),448>,449) -> wasmtime::component::__internal::Vec<450(wasmtime::component::__internal::String, u8),451>;452fn string_list(453&mut self,454x: wasmtime::component::__internal::Vec<455wasmtime::component::__internal::String,456>,457) -> wasmtime::component::__internal::Vec<458wasmtime::component::__internal::String,459>;460fn record_list(461&mut self,462x: wasmtime::component::__internal::Vec<SomeRecord>,463) -> wasmtime::component::__internal::Vec<OtherRecord>;464fn record_list_reverse(465&mut self,466x: wasmtime::component::__internal::Vec<OtherRecord>,467) -> wasmtime::component::__internal::Vec<SomeRecord>;468fn variant_list(469&mut self,470x: wasmtime::component::__internal::Vec<SomeVariant>,471) -> wasmtime::component::__internal::Vec<OtherVariant>;472fn load_store_everything(473&mut self,474a: LoadStoreAllSizes,475) -> LoadStoreAllSizes;476}477impl<_T: Host + ?Sized> Host for &mut _T {478fn list_u8_param(479&mut self,480x: wasmtime::component::__internal::Vec<u8>,481) -> () {482Host::list_u8_param(*self, x)483}484fn list_u16_param(485&mut self,486x: wasmtime::component::__internal::Vec<u16>,487) -> () {488Host::list_u16_param(*self, x)489}490fn list_u32_param(491&mut self,492x: wasmtime::component::__internal::Vec<u32>,493) -> () {494Host::list_u32_param(*self, x)495}496fn list_u64_param(497&mut self,498x: wasmtime::component::__internal::Vec<u64>,499) -> () {500Host::list_u64_param(*self, x)501}502fn list_s8_param(503&mut self,504x: wasmtime::component::__internal::Vec<i8>,505) -> () {506Host::list_s8_param(*self, x)507}508fn list_s16_param(509&mut self,510x: wasmtime::component::__internal::Vec<i16>,511) -> () {512Host::list_s16_param(*self, x)513}514fn list_s32_param(515&mut self,516x: wasmtime::component::__internal::Vec<i32>,517) -> () {518Host::list_s32_param(*self, x)519}520fn list_s64_param(521&mut self,522x: wasmtime::component::__internal::Vec<i64>,523) -> () {524Host::list_s64_param(*self, x)525}526fn list_f32_param(527&mut self,528x: wasmtime::component::__internal::Vec<f32>,529) -> () {530Host::list_f32_param(*self, x)531}532fn list_f64_param(533&mut self,534x: wasmtime::component::__internal::Vec<f64>,535) -> () {536Host::list_f64_param(*self, x)537}538fn list_u8_ret(&mut self) -> wasmtime::component::__internal::Vec<u8> {539Host::list_u8_ret(*self)540}541fn list_u16_ret(&mut self) -> wasmtime::component::__internal::Vec<u16> {542Host::list_u16_ret(*self)543}544fn list_u32_ret(&mut self) -> wasmtime::component::__internal::Vec<u32> {545Host::list_u32_ret(*self)546}547fn list_u64_ret(&mut self) -> wasmtime::component::__internal::Vec<u64> {548Host::list_u64_ret(*self)549}550fn list_s8_ret(&mut self) -> wasmtime::component::__internal::Vec<i8> {551Host::list_s8_ret(*self)552}553fn list_s16_ret(&mut self) -> wasmtime::component::__internal::Vec<i16> {554Host::list_s16_ret(*self)555}556fn list_s32_ret(&mut self) -> wasmtime::component::__internal::Vec<i32> {557Host::list_s32_ret(*self)558}559fn list_s64_ret(&mut self) -> wasmtime::component::__internal::Vec<i64> {560Host::list_s64_ret(*self)561}562fn list_f32_ret(&mut self) -> wasmtime::component::__internal::Vec<f32> {563Host::list_f32_ret(*self)564}565fn list_f64_ret(&mut self) -> wasmtime::component::__internal::Vec<f64> {566Host::list_f64_ret(*self)567}568fn tuple_list(569&mut self,570x: wasmtime::component::__internal::Vec<(u8, i8)>,571) -> wasmtime::component::__internal::Vec<(i64, u32)> {572Host::tuple_list(*self, x)573}574fn string_list_arg(575&mut self,576a: wasmtime::component::__internal::Vec<577wasmtime::component::__internal::String,578>,579) -> () {580Host::string_list_arg(*self, a)581}582fn string_list_ret(583&mut self,584) -> wasmtime::component::__internal::Vec<585wasmtime::component::__internal::String,586> {587Host::string_list_ret(*self)588}589fn tuple_string_list(590&mut self,591x: wasmtime::component::__internal::Vec<592(u8, wasmtime::component::__internal::String),593>,594) -> wasmtime::component::__internal::Vec<595(wasmtime::component::__internal::String, u8),596> {597Host::tuple_string_list(*self, x)598}599fn string_list(600&mut self,601x: wasmtime::component::__internal::Vec<602wasmtime::component::__internal::String,603>,604) -> wasmtime::component::__internal::Vec<605wasmtime::component::__internal::String,606> {607Host::string_list(*self, x)608}609fn record_list(610&mut self,611x: wasmtime::component::__internal::Vec<SomeRecord>,612) -> wasmtime::component::__internal::Vec<OtherRecord> {613Host::record_list(*self, x)614}615fn record_list_reverse(616&mut self,617x: wasmtime::component::__internal::Vec<OtherRecord>,618) -> wasmtime::component::__internal::Vec<SomeRecord> {619Host::record_list_reverse(*self, x)620}621fn variant_list(622&mut self,623x: wasmtime::component::__internal::Vec<SomeVariant>,624) -> wasmtime::component::__internal::Vec<OtherVariant> {625Host::variant_list(*self, x)626}627fn load_store_everything(628&mut self,629a: LoadStoreAllSizes,630) -> LoadStoreAllSizes {631Host::load_store_everything(*self, a)632}633}634pub fn add_to_linker<T, D>(635linker: &mut wasmtime::component::Linker<T>,636host_getter: fn(&mut T) -> D::Data<'_>,637) -> wasmtime::Result<()>638where639D: HostWithStore,640for<'a> D::Data<'a>: Host,641T: 'static,642{643let mut inst = linker.instance("foo:foo/lists")?;644inst.func_wrap(645"list-u8-param",646move |647mut caller: wasmtime::StoreContextMut<'_, T>,648(arg0,): (wasmtime::component::__internal::Vec<u8>,)|649{650let host = &mut host_getter(caller.data_mut());651let r = Host::list_u8_param(host, arg0);652Ok(r)653},654)?;655inst.func_wrap(656"list-u16-param",657move |658mut caller: wasmtime::StoreContextMut<'_, T>,659(arg0,): (wasmtime::component::__internal::Vec<u16>,)|660{661let host = &mut host_getter(caller.data_mut());662let r = Host::list_u16_param(host, arg0);663Ok(r)664},665)?;666inst.func_wrap(667"list-u32-param",668move |669mut caller: wasmtime::StoreContextMut<'_, T>,670(arg0,): (wasmtime::component::__internal::Vec<u32>,)|671{672let host = &mut host_getter(caller.data_mut());673let r = Host::list_u32_param(host, arg0);674Ok(r)675},676)?;677inst.func_wrap(678"list-u64-param",679move |680mut caller: wasmtime::StoreContextMut<'_, T>,681(arg0,): (wasmtime::component::__internal::Vec<u64>,)|682{683let host = &mut host_getter(caller.data_mut());684let r = Host::list_u64_param(host, arg0);685Ok(r)686},687)?;688inst.func_wrap(689"list-s8-param",690move |691mut caller: wasmtime::StoreContextMut<'_, T>,692(arg0,): (wasmtime::component::__internal::Vec<i8>,)|693{694let host = &mut host_getter(caller.data_mut());695let r = Host::list_s8_param(host, arg0);696Ok(r)697},698)?;699inst.func_wrap(700"list-s16-param",701move |702mut caller: wasmtime::StoreContextMut<'_, T>,703(arg0,): (wasmtime::component::__internal::Vec<i16>,)|704{705let host = &mut host_getter(caller.data_mut());706let r = Host::list_s16_param(host, arg0);707Ok(r)708},709)?;710inst.func_wrap(711"list-s32-param",712move |713mut caller: wasmtime::StoreContextMut<'_, T>,714(arg0,): (wasmtime::component::__internal::Vec<i32>,)|715{716let host = &mut host_getter(caller.data_mut());717let r = Host::list_s32_param(host, arg0);718Ok(r)719},720)?;721inst.func_wrap(722"list-s64-param",723move |724mut caller: wasmtime::StoreContextMut<'_, T>,725(arg0,): (wasmtime::component::__internal::Vec<i64>,)|726{727let host = &mut host_getter(caller.data_mut());728let r = Host::list_s64_param(host, arg0);729Ok(r)730},731)?;732inst.func_wrap(733"list-f32-param",734move |735mut caller: wasmtime::StoreContextMut<'_, T>,736(arg0,): (wasmtime::component::__internal::Vec<f32>,)|737{738let host = &mut host_getter(caller.data_mut());739let r = Host::list_f32_param(host, arg0);740Ok(r)741},742)?;743inst.func_wrap(744"list-f64-param",745move |746mut caller: wasmtime::StoreContextMut<'_, T>,747(arg0,): (wasmtime::component::__internal::Vec<f64>,)|748{749let host = &mut host_getter(caller.data_mut());750let r = Host::list_f64_param(host, arg0);751Ok(r)752},753)?;754inst.func_wrap(755"list-u8-ret",756move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {757let host = &mut host_getter(caller.data_mut());758let r = Host::list_u8_ret(host);759Ok((r,))760},761)?;762inst.func_wrap(763"list-u16-ret",764move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {765let host = &mut host_getter(caller.data_mut());766let r = Host::list_u16_ret(host);767Ok((r,))768},769)?;770inst.func_wrap(771"list-u32-ret",772move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {773let host = &mut host_getter(caller.data_mut());774let r = Host::list_u32_ret(host);775Ok((r,))776},777)?;778inst.func_wrap(779"list-u64-ret",780move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {781let host = &mut host_getter(caller.data_mut());782let r = Host::list_u64_ret(host);783Ok((r,))784},785)?;786inst.func_wrap(787"list-s8-ret",788move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {789let host = &mut host_getter(caller.data_mut());790let r = Host::list_s8_ret(host);791Ok((r,))792},793)?;794inst.func_wrap(795"list-s16-ret",796move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {797let host = &mut host_getter(caller.data_mut());798let r = Host::list_s16_ret(host);799Ok((r,))800},801)?;802inst.func_wrap(803"list-s32-ret",804move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {805let host = &mut host_getter(caller.data_mut());806let r = Host::list_s32_ret(host);807Ok((r,))808},809)?;810inst.func_wrap(811"list-s64-ret",812move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {813let host = &mut host_getter(caller.data_mut());814let r = Host::list_s64_ret(host);815Ok((r,))816},817)?;818inst.func_wrap(819"list-f32-ret",820move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {821let host = &mut host_getter(caller.data_mut());822let r = Host::list_f32_ret(host);823Ok((r,))824},825)?;826inst.func_wrap(827"list-f64-ret",828move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {829let host = &mut host_getter(caller.data_mut());830let r = Host::list_f64_ret(host);831Ok((r,))832},833)?;834inst.func_wrap(835"tuple-list",836move |837mut caller: wasmtime::StoreContextMut<'_, T>,838(arg0,): (wasmtime::component::__internal::Vec<(u8, i8)>,)|839{840let host = &mut host_getter(caller.data_mut());841let r = Host::tuple_list(host, arg0);842Ok((r,))843},844)?;845inst.func_wrap(846"string-list-arg",847move |848mut caller: wasmtime::StoreContextMut<'_, T>,849(850arg0,851): (852wasmtime::component::__internal::Vec<853wasmtime::component::__internal::String,854>,855)|856{857let host = &mut host_getter(caller.data_mut());858let r = Host::string_list_arg(host, arg0);859Ok(r)860},861)?;862inst.func_wrap(863"string-list-ret",864move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {865let host = &mut host_getter(caller.data_mut());866let r = Host::string_list_ret(host);867Ok((r,))868},869)?;870inst.func_wrap(871"tuple-string-list",872move |873mut caller: wasmtime::StoreContextMut<'_, T>,874(875arg0,876): (877wasmtime::component::__internal::Vec<878(u8, wasmtime::component::__internal::String),879>,880)|881{882let host = &mut host_getter(caller.data_mut());883let r = Host::tuple_string_list(host, arg0);884Ok((r,))885},886)?;887inst.func_wrap(888"string-list",889move |890mut caller: wasmtime::StoreContextMut<'_, T>,891(892arg0,893): (894wasmtime::component::__internal::Vec<895wasmtime::component::__internal::String,896>,897)|898{899let host = &mut host_getter(caller.data_mut());900let r = Host::string_list(host, arg0);901Ok((r,))902},903)?;904inst.func_wrap(905"record-list",906move |907mut caller: wasmtime::StoreContextMut<'_, T>,908(arg0,): (wasmtime::component::__internal::Vec<SomeRecord>,)|909{910let host = &mut host_getter(caller.data_mut());911let r = Host::record_list(host, arg0);912Ok((r,))913},914)?;915inst.func_wrap(916"record-list-reverse",917move |918mut caller: wasmtime::StoreContextMut<'_, T>,919(arg0,): (wasmtime::component::__internal::Vec<OtherRecord>,)|920{921let host = &mut host_getter(caller.data_mut());922let r = Host::record_list_reverse(host, arg0);923Ok((r,))924},925)?;926inst.func_wrap(927"variant-list",928move |929mut caller: wasmtime::StoreContextMut<'_, T>,930(arg0,): (wasmtime::component::__internal::Vec<SomeVariant>,)|931{932let host = &mut host_getter(caller.data_mut());933let r = Host::variant_list(host, arg0);934Ok((r,))935},936)?;937inst.func_wrap(938"load-store-everything",939move |940mut caller: wasmtime::StoreContextMut<'_, T>,941(arg0,): (LoadStoreAllSizes,)|942{943let host = &mut host_getter(caller.data_mut());944let r = Host::load_store_everything(host, arg0);945Ok((r,))946},947)?;948Ok(())949}950}951}952}953pub mod exports {954pub mod foo {955pub mod foo {956#[allow(clippy::all)]957pub mod lists {958#[allow(unused_imports)]959use wasmtime::component::__internal::{anyhow, Box};960#[derive(wasmtime::component::ComponentType)]961#[derive(wasmtime::component::Lift)]962#[derive(wasmtime::component::Lower)]963#[component(record)]964#[derive(Clone)]965pub struct OtherRecord {966#[component(name = "a1")]967pub a1: u32,968#[component(name = "a2")]969pub a2: u64,970#[component(name = "a3")]971pub a3: i32,972#[component(name = "a4")]973pub a4: i64,974#[component(name = "b")]975pub b: wasmtime::component::__internal::String,976#[component(name = "c")]977pub c: wasmtime::component::__internal::Vec<u8>,978}979impl core::fmt::Debug for OtherRecord {980fn fmt(981&self,982f: &mut core::fmt::Formatter<'_>,983) -> core::fmt::Result {984f.debug_struct("OtherRecord")985.field("a1", &self.a1)986.field("a2", &self.a2)987.field("a3", &self.a3)988.field("a4", &self.a4)989.field("b", &self.b)990.field("c", &self.c)991.finish()992}993}994const _: () = {995assert!(99648 == < OtherRecord as wasmtime::component::ComponentType997>::SIZE32998);999assert!(10008 == < OtherRecord as wasmtime::component::ComponentType1001>::ALIGN321002);1003};1004#[derive(wasmtime::component::ComponentType)]1005#[derive(wasmtime::component::Lift)]1006#[derive(wasmtime::component::Lower)]1007#[component(record)]1008#[derive(Clone)]1009pub struct SomeRecord {1010#[component(name = "x")]1011pub x: wasmtime::component::__internal::String,1012#[component(name = "y")]1013pub y: OtherRecord,1014#[component(name = "z")]1015pub z: wasmtime::component::__internal::Vec<OtherRecord>,1016#[component(name = "c1")]1017pub c1: u32,1018#[component(name = "c2")]1019pub c2: u64,1020#[component(name = "c3")]1021pub c3: i32,1022#[component(name = "c4")]1023pub c4: i64,1024}1025impl core::fmt::Debug for SomeRecord {1026fn fmt(1027&self,1028f: &mut core::fmt::Formatter<'_>,1029) -> core::fmt::Result {1030f.debug_struct("SomeRecord")1031.field("x", &self.x)1032.field("y", &self.y)1033.field("z", &self.z)1034.field("c1", &self.c1)1035.field("c2", &self.c2)1036.field("c3", &self.c3)1037.field("c4", &self.c4)1038.finish()1039}1040}1041const _: () = {1042assert!(104396 == < SomeRecord as wasmtime::component::ComponentType1044>::SIZE321045);1046assert!(10478 == < SomeRecord as wasmtime::component::ComponentType1048>::ALIGN321049);1050};1051#[derive(wasmtime::component::ComponentType)]1052#[derive(wasmtime::component::Lift)]1053#[derive(wasmtime::component::Lower)]1054#[component(variant)]1055#[derive(Clone)]1056pub enum OtherVariant {1057#[component(name = "a")]1058A,1059#[component(name = "b")]1060B(u32),1061#[component(name = "c")]1062C(wasmtime::component::__internal::String),1063}1064impl core::fmt::Debug for OtherVariant {1065fn fmt(1066&self,1067f: &mut core::fmt::Formatter<'_>,1068) -> core::fmt::Result {1069match self {1070OtherVariant::A => f.debug_tuple("OtherVariant::A").finish(),1071OtherVariant::B(e) => {1072f.debug_tuple("OtherVariant::B").field(e).finish()1073}1074OtherVariant::C(e) => {1075f.debug_tuple("OtherVariant::C").field(e).finish()1076}1077}1078}1079}1080const _: () = {1081assert!(108212 == < OtherVariant as wasmtime::component::ComponentType1083>::SIZE321084);1085assert!(10864 == < OtherVariant as wasmtime::component::ComponentType1087>::ALIGN321088);1089};1090#[derive(wasmtime::component::ComponentType)]1091#[derive(wasmtime::component::Lift)]1092#[derive(wasmtime::component::Lower)]1093#[component(variant)]1094#[derive(Clone)]1095pub enum SomeVariant {1096#[component(name = "a")]1097A(wasmtime::component::__internal::String),1098#[component(name = "b")]1099B,1100#[component(name = "c")]1101C(u32),1102#[component(name = "d")]1103D(wasmtime::component::__internal::Vec<OtherVariant>),1104}1105impl core::fmt::Debug for SomeVariant {1106fn fmt(1107&self,1108f: &mut core::fmt::Formatter<'_>,1109) -> core::fmt::Result {1110match self {1111SomeVariant::A(e) => {1112f.debug_tuple("SomeVariant::A").field(e).finish()1113}1114SomeVariant::B => f.debug_tuple("SomeVariant::B").finish(),1115SomeVariant::C(e) => {1116f.debug_tuple("SomeVariant::C").field(e).finish()1117}1118SomeVariant::D(e) => {1119f.debug_tuple("SomeVariant::D").field(e).finish()1120}1121}1122}1123}1124const _: () = {1125assert!(112612 == < SomeVariant as wasmtime::component::ComponentType1127>::SIZE321128);1129assert!(11304 == < SomeVariant as wasmtime::component::ComponentType1131>::ALIGN321132);1133};1134pub type LoadStoreAllSizes = wasmtime::component::__internal::Vec<1135(1136wasmtime::component::__internal::String,1137u8,1138i8,1139u16,1140i16,1141u32,1142i32,1143u64,1144i64,1145f32,1146f64,1147char,1148),1149>;1150const _: () = {1151assert!(11528 == < LoadStoreAllSizes as wasmtime::component::ComponentType1153>::SIZE321154);1155assert!(11564 == < LoadStoreAllSizes as wasmtime::component::ComponentType1157>::ALIGN321158);1159};1160pub struct Guest {1161list_u8_param: wasmtime::component::Func,1162list_u16_param: wasmtime::component::Func,1163list_u32_param: wasmtime::component::Func,1164list_u64_param: wasmtime::component::Func,1165list_s8_param: wasmtime::component::Func,1166list_s16_param: wasmtime::component::Func,1167list_s32_param: wasmtime::component::Func,1168list_s64_param: wasmtime::component::Func,1169list_f32_param: wasmtime::component::Func,1170list_f64_param: wasmtime::component::Func,1171list_u8_ret: wasmtime::component::Func,1172list_u16_ret: wasmtime::component::Func,1173list_u32_ret: wasmtime::component::Func,1174list_u64_ret: wasmtime::component::Func,1175list_s8_ret: wasmtime::component::Func,1176list_s16_ret: wasmtime::component::Func,1177list_s32_ret: wasmtime::component::Func,1178list_s64_ret: wasmtime::component::Func,1179list_f32_ret: wasmtime::component::Func,1180list_f64_ret: wasmtime::component::Func,1181tuple_list: wasmtime::component::Func,1182string_list_arg: wasmtime::component::Func,1183string_list_ret: wasmtime::component::Func,1184tuple_string_list: wasmtime::component::Func,1185string_list: wasmtime::component::Func,1186record_list: wasmtime::component::Func,1187record_list_reverse: wasmtime::component::Func,1188variant_list: wasmtime::component::Func,1189load_store_everything: wasmtime::component::Func,1190}1191#[derive(Clone)]1192pub struct GuestIndices {1193list_u8_param: wasmtime::component::ComponentExportIndex,1194list_u16_param: wasmtime::component::ComponentExportIndex,1195list_u32_param: wasmtime::component::ComponentExportIndex,1196list_u64_param: wasmtime::component::ComponentExportIndex,1197list_s8_param: wasmtime::component::ComponentExportIndex,1198list_s16_param: wasmtime::component::ComponentExportIndex,1199list_s32_param: wasmtime::component::ComponentExportIndex,1200list_s64_param: wasmtime::component::ComponentExportIndex,1201list_f32_param: wasmtime::component::ComponentExportIndex,1202list_f64_param: wasmtime::component::ComponentExportIndex,1203list_u8_ret: wasmtime::component::ComponentExportIndex,1204list_u16_ret: wasmtime::component::ComponentExportIndex,1205list_u32_ret: wasmtime::component::ComponentExportIndex,1206list_u64_ret: wasmtime::component::ComponentExportIndex,1207list_s8_ret: wasmtime::component::ComponentExportIndex,1208list_s16_ret: wasmtime::component::ComponentExportIndex,1209list_s32_ret: wasmtime::component::ComponentExportIndex,1210list_s64_ret: wasmtime::component::ComponentExportIndex,1211list_f32_ret: wasmtime::component::ComponentExportIndex,1212list_f64_ret: wasmtime::component::ComponentExportIndex,1213tuple_list: wasmtime::component::ComponentExportIndex,1214string_list_arg: wasmtime::component::ComponentExportIndex,1215string_list_ret: wasmtime::component::ComponentExportIndex,1216tuple_string_list: wasmtime::component::ComponentExportIndex,1217string_list: wasmtime::component::ComponentExportIndex,1218record_list: wasmtime::component::ComponentExportIndex,1219record_list_reverse: wasmtime::component::ComponentExportIndex,1220variant_list: wasmtime::component::ComponentExportIndex,1221load_store_everything: wasmtime::component::ComponentExportIndex,1222}1223impl GuestIndices {1224/// Constructor for [`GuestIndices`] which takes a1225/// [`Component`](wasmtime::component::Component) as input and can be executed1226/// before instantiation.1227///1228/// This constructor can be used to front-load string lookups to find exports1229/// within a component.1230pub fn new<_T>(1231_instance_pre: &wasmtime::component::InstancePre<_T>,1232) -> wasmtime::Result<GuestIndices> {1233let instance = _instance_pre1234.component()1235.get_export_index(None, "foo:foo/lists")1236.ok_or_else(|| {1237anyhow::anyhow!(1238"no exported instance named `foo:foo/lists`"1239)1240})?;1241let mut lookup = move |name| {1242_instance_pre1243.component()1244.get_export_index(Some(&instance), name)1245.ok_or_else(|| {1246anyhow::anyhow!(1247"instance export `foo:foo/lists` does \1248not have export `{name}`"1249)1250})1251};1252let _ = &mut lookup;1253let list_u8_param = lookup("list-u8-param")?;1254let list_u16_param = lookup("list-u16-param")?;1255let list_u32_param = lookup("list-u32-param")?;1256let list_u64_param = lookup("list-u64-param")?;1257let list_s8_param = lookup("list-s8-param")?;1258let list_s16_param = lookup("list-s16-param")?;1259let list_s32_param = lookup("list-s32-param")?;1260let list_s64_param = lookup("list-s64-param")?;1261let list_f32_param = lookup("list-f32-param")?;1262let list_f64_param = lookup("list-f64-param")?;1263let list_u8_ret = lookup("list-u8-ret")?;1264let list_u16_ret = lookup("list-u16-ret")?;1265let list_u32_ret = lookup("list-u32-ret")?;1266let list_u64_ret = lookup("list-u64-ret")?;1267let list_s8_ret = lookup("list-s8-ret")?;1268let list_s16_ret = lookup("list-s16-ret")?;1269let list_s32_ret = lookup("list-s32-ret")?;1270let list_s64_ret = lookup("list-s64-ret")?;1271let list_f32_ret = lookup("list-f32-ret")?;1272let list_f64_ret = lookup("list-f64-ret")?;1273let tuple_list = lookup("tuple-list")?;1274let string_list_arg = lookup("string-list-arg")?;1275let string_list_ret = lookup("string-list-ret")?;1276let tuple_string_list = lookup("tuple-string-list")?;1277let string_list = lookup("string-list")?;1278let record_list = lookup("record-list")?;1279let record_list_reverse = lookup("record-list-reverse")?;1280let variant_list = lookup("variant-list")?;1281let load_store_everything = lookup("load-store-everything")?;1282Ok(GuestIndices {1283list_u8_param,1284list_u16_param,1285list_u32_param,1286list_u64_param,1287list_s8_param,1288list_s16_param,1289list_s32_param,1290list_s64_param,1291list_f32_param,1292list_f64_param,1293list_u8_ret,1294list_u16_ret,1295list_u32_ret,1296list_u64_ret,1297list_s8_ret,1298list_s16_ret,1299list_s32_ret,1300list_s64_ret,1301list_f32_ret,1302list_f64_ret,1303tuple_list,1304string_list_arg,1305string_list_ret,1306tuple_string_list,1307string_list,1308record_list,1309record_list_reverse,1310variant_list,1311load_store_everything,1312})1313}1314pub fn load(1315&self,1316mut store: impl wasmtime::AsContextMut,1317instance: &wasmtime::component::Instance,1318) -> wasmtime::Result<Guest> {1319let _instance = instance;1320let _instance_pre = _instance.instance_pre(&store);1321let _instance_type = _instance_pre.instance_type();1322let mut store = store.as_context_mut();1323let _ = &mut store;1324let list_u8_param = *_instance1325.get_typed_func::<1326(&[u8],),1327(),1328>(&mut store, &self.list_u8_param)?1329.func();1330let list_u16_param = *_instance1331.get_typed_func::<1332(&[u16],),1333(),1334>(&mut store, &self.list_u16_param)?1335.func();1336let list_u32_param = *_instance1337.get_typed_func::<1338(&[u32],),1339(),1340>(&mut store, &self.list_u32_param)?1341.func();1342let list_u64_param = *_instance1343.get_typed_func::<1344(&[u64],),1345(),1346>(&mut store, &self.list_u64_param)?1347.func();1348let list_s8_param = *_instance1349.get_typed_func::<1350(&[i8],),1351(),1352>(&mut store, &self.list_s8_param)?1353.func();1354let list_s16_param = *_instance1355.get_typed_func::<1356(&[i16],),1357(),1358>(&mut store, &self.list_s16_param)?1359.func();1360let list_s32_param = *_instance1361.get_typed_func::<1362(&[i32],),1363(),1364>(&mut store, &self.list_s32_param)?1365.func();1366let list_s64_param = *_instance1367.get_typed_func::<1368(&[i64],),1369(),1370>(&mut store, &self.list_s64_param)?1371.func();1372let list_f32_param = *_instance1373.get_typed_func::<1374(&[f32],),1375(),1376>(&mut store, &self.list_f32_param)?1377.func();1378let list_f64_param = *_instance1379.get_typed_func::<1380(&[f64],),1381(),1382>(&mut store, &self.list_f64_param)?1383.func();1384let list_u8_ret = *_instance1385.get_typed_func::<1386(),1387(wasmtime::component::__internal::Vec<u8>,),1388>(&mut store, &self.list_u8_ret)?1389.func();1390let list_u16_ret = *_instance1391.get_typed_func::<1392(),1393(wasmtime::component::__internal::Vec<u16>,),1394>(&mut store, &self.list_u16_ret)?1395.func();1396let list_u32_ret = *_instance1397.get_typed_func::<1398(),1399(wasmtime::component::__internal::Vec<u32>,),1400>(&mut store, &self.list_u32_ret)?1401.func();1402let list_u64_ret = *_instance1403.get_typed_func::<1404(),1405(wasmtime::component::__internal::Vec<u64>,),1406>(&mut store, &self.list_u64_ret)?1407.func();1408let list_s8_ret = *_instance1409.get_typed_func::<1410(),1411(wasmtime::component::__internal::Vec<i8>,),1412>(&mut store, &self.list_s8_ret)?1413.func();1414let list_s16_ret = *_instance1415.get_typed_func::<1416(),1417(wasmtime::component::__internal::Vec<i16>,),1418>(&mut store, &self.list_s16_ret)?1419.func();1420let list_s32_ret = *_instance1421.get_typed_func::<1422(),1423(wasmtime::component::__internal::Vec<i32>,),1424>(&mut store, &self.list_s32_ret)?1425.func();1426let list_s64_ret = *_instance1427.get_typed_func::<1428(),1429(wasmtime::component::__internal::Vec<i64>,),1430>(&mut store, &self.list_s64_ret)?1431.func();1432let list_f32_ret = *_instance1433.get_typed_func::<1434(),1435(wasmtime::component::__internal::Vec<f32>,),1436>(&mut store, &self.list_f32_ret)?1437.func();1438let list_f64_ret = *_instance1439.get_typed_func::<1440(),1441(wasmtime::component::__internal::Vec<f64>,),1442>(&mut store, &self.list_f64_ret)?1443.func();1444let tuple_list = *_instance1445.get_typed_func::<1446(&[(u8, i8)],),1447(wasmtime::component::__internal::Vec<(i64, u32)>,),1448>(&mut store, &self.tuple_list)?1449.func();1450let string_list_arg = *_instance1451.get_typed_func::<1452(&[wasmtime::component::__internal::String],),1453(),1454>(&mut store, &self.string_list_arg)?1455.func();1456let string_list_ret = *_instance1457.get_typed_func::<1458(),1459(1460wasmtime::component::__internal::Vec<1461wasmtime::component::__internal::String,1462>,1463),1464>(&mut store, &self.string_list_ret)?1465.func();1466let tuple_string_list = *_instance1467.get_typed_func::<1468(&[(u8, wasmtime::component::__internal::String)],),1469(1470wasmtime::component::__internal::Vec<1471(wasmtime::component::__internal::String, u8),1472>,1473),1474>(&mut store, &self.tuple_string_list)?1475.func();1476let string_list = *_instance1477.get_typed_func::<1478(&[wasmtime::component::__internal::String],),1479(1480wasmtime::component::__internal::Vec<1481wasmtime::component::__internal::String,1482>,1483),1484>(&mut store, &self.string_list)?1485.func();1486let record_list = *_instance1487.get_typed_func::<1488(&[SomeRecord],),1489(wasmtime::component::__internal::Vec<OtherRecord>,),1490>(&mut store, &self.record_list)?1491.func();1492let record_list_reverse = *_instance1493.get_typed_func::<1494(&[OtherRecord],),1495(wasmtime::component::__internal::Vec<SomeRecord>,),1496>(&mut store, &self.record_list_reverse)?1497.func();1498let variant_list = *_instance1499.get_typed_func::<1500(&[SomeVariant],),1501(wasmtime::component::__internal::Vec<OtherVariant>,),1502>(&mut store, &self.variant_list)?1503.func();1504let load_store_everything = *_instance1505.get_typed_func::<1506(&LoadStoreAllSizes,),1507(LoadStoreAllSizes,),1508>(&mut store, &self.load_store_everything)?1509.func();1510Ok(Guest {1511list_u8_param,1512list_u16_param,1513list_u32_param,1514list_u64_param,1515list_s8_param,1516list_s16_param,1517list_s32_param,1518list_s64_param,1519list_f32_param,1520list_f64_param,1521list_u8_ret,1522list_u16_ret,1523list_u32_ret,1524list_u64_ret,1525list_s8_ret,1526list_s16_ret,1527list_s32_ret,1528list_s64_ret,1529list_f32_ret,1530list_f64_ret,1531tuple_list,1532string_list_arg,1533string_list_ret,1534tuple_string_list,1535string_list,1536record_list,1537record_list_reverse,1538variant_list,1539load_store_everything,1540})1541}1542}1543impl Guest {1544pub fn call_list_u8_param<S: wasmtime::AsContextMut>(1545&self,1546mut store: S,1547arg0: &[u8],1548) -> wasmtime::Result<()> {1549let callee = unsafe {1550wasmtime::component::TypedFunc::<1551(&[u8],),1552(),1553>::new_unchecked(self.list_u8_param)1554};1555let () = callee.call(store.as_context_mut(), (arg0,))?;1556callee.post_return(store.as_context_mut())?;1557Ok(())1558}1559pub fn call_list_u16_param<S: wasmtime::AsContextMut>(1560&self,1561mut store: S,1562arg0: &[u16],1563) -> wasmtime::Result<()> {1564let callee = unsafe {1565wasmtime::component::TypedFunc::<1566(&[u16],),1567(),1568>::new_unchecked(self.list_u16_param)1569};1570let () = callee.call(store.as_context_mut(), (arg0,))?;1571callee.post_return(store.as_context_mut())?;1572Ok(())1573}1574pub fn call_list_u32_param<S: wasmtime::AsContextMut>(1575&self,1576mut store: S,1577arg0: &[u32],1578) -> wasmtime::Result<()> {1579let callee = unsafe {1580wasmtime::component::TypedFunc::<1581(&[u32],),1582(),1583>::new_unchecked(self.list_u32_param)1584};1585let () = callee.call(store.as_context_mut(), (arg0,))?;1586callee.post_return(store.as_context_mut())?;1587Ok(())1588}1589pub fn call_list_u64_param<S: wasmtime::AsContextMut>(1590&self,1591mut store: S,1592arg0: &[u64],1593) -> wasmtime::Result<()> {1594let callee = unsafe {1595wasmtime::component::TypedFunc::<1596(&[u64],),1597(),1598>::new_unchecked(self.list_u64_param)1599};1600let () = callee.call(store.as_context_mut(), (arg0,))?;1601callee.post_return(store.as_context_mut())?;1602Ok(())1603}1604pub fn call_list_s8_param<S: wasmtime::AsContextMut>(1605&self,1606mut store: S,1607arg0: &[i8],1608) -> wasmtime::Result<()> {1609let callee = unsafe {1610wasmtime::component::TypedFunc::<1611(&[i8],),1612(),1613>::new_unchecked(self.list_s8_param)1614};1615let () = callee.call(store.as_context_mut(), (arg0,))?;1616callee.post_return(store.as_context_mut())?;1617Ok(())1618}1619pub fn call_list_s16_param<S: wasmtime::AsContextMut>(1620&self,1621mut store: S,1622arg0: &[i16],1623) -> wasmtime::Result<()> {1624let callee = unsafe {1625wasmtime::component::TypedFunc::<1626(&[i16],),1627(),1628>::new_unchecked(self.list_s16_param)1629};1630let () = callee.call(store.as_context_mut(), (arg0,))?;1631callee.post_return(store.as_context_mut())?;1632Ok(())1633}1634pub fn call_list_s32_param<S: wasmtime::AsContextMut>(1635&self,1636mut store: S,1637arg0: &[i32],1638) -> wasmtime::Result<()> {1639let callee = unsafe {1640wasmtime::component::TypedFunc::<1641(&[i32],),1642(),1643>::new_unchecked(self.list_s32_param)1644};1645let () = callee.call(store.as_context_mut(), (arg0,))?;1646callee.post_return(store.as_context_mut())?;1647Ok(())1648}1649pub fn call_list_s64_param<S: wasmtime::AsContextMut>(1650&self,1651mut store: S,1652arg0: &[i64],1653) -> wasmtime::Result<()> {1654let callee = unsafe {1655wasmtime::component::TypedFunc::<1656(&[i64],),1657(),1658>::new_unchecked(self.list_s64_param)1659};1660let () = callee.call(store.as_context_mut(), (arg0,))?;1661callee.post_return(store.as_context_mut())?;1662Ok(())1663}1664pub fn call_list_f32_param<S: wasmtime::AsContextMut>(1665&self,1666mut store: S,1667arg0: &[f32],1668) -> wasmtime::Result<()> {1669let callee = unsafe {1670wasmtime::component::TypedFunc::<1671(&[f32],),1672(),1673>::new_unchecked(self.list_f32_param)1674};1675let () = callee.call(store.as_context_mut(), (arg0,))?;1676callee.post_return(store.as_context_mut())?;1677Ok(())1678}1679pub fn call_list_f64_param<S: wasmtime::AsContextMut>(1680&self,1681mut store: S,1682arg0: &[f64],1683) -> wasmtime::Result<()> {1684let callee = unsafe {1685wasmtime::component::TypedFunc::<1686(&[f64],),1687(),1688>::new_unchecked(self.list_f64_param)1689};1690let () = callee.call(store.as_context_mut(), (arg0,))?;1691callee.post_return(store.as_context_mut())?;1692Ok(())1693}1694pub fn call_list_u8_ret<S: wasmtime::AsContextMut>(1695&self,1696mut store: S,1697) -> wasmtime::Result<wasmtime::component::__internal::Vec<u8>> {1698let callee = unsafe {1699wasmtime::component::TypedFunc::<1700(),1701(wasmtime::component::__internal::Vec<u8>,),1702>::new_unchecked(self.list_u8_ret)1703};1704let (ret0,) = callee.call(store.as_context_mut(), ())?;1705callee.post_return(store.as_context_mut())?;1706Ok(ret0)1707}1708pub fn call_list_u16_ret<S: wasmtime::AsContextMut>(1709&self,1710mut store: S,1711) -> wasmtime::Result<wasmtime::component::__internal::Vec<u16>> {1712let callee = unsafe {1713wasmtime::component::TypedFunc::<1714(),1715(wasmtime::component::__internal::Vec<u16>,),1716>::new_unchecked(self.list_u16_ret)1717};1718let (ret0,) = callee.call(store.as_context_mut(), ())?;1719callee.post_return(store.as_context_mut())?;1720Ok(ret0)1721}1722pub fn call_list_u32_ret<S: wasmtime::AsContextMut>(1723&self,1724mut store: S,1725) -> wasmtime::Result<wasmtime::component::__internal::Vec<u32>> {1726let callee = unsafe {1727wasmtime::component::TypedFunc::<1728(),1729(wasmtime::component::__internal::Vec<u32>,),1730>::new_unchecked(self.list_u32_ret)1731};1732let (ret0,) = callee.call(store.as_context_mut(), ())?;1733callee.post_return(store.as_context_mut())?;1734Ok(ret0)1735}1736pub fn call_list_u64_ret<S: wasmtime::AsContextMut>(1737&self,1738mut store: S,1739) -> wasmtime::Result<wasmtime::component::__internal::Vec<u64>> {1740let callee = unsafe {1741wasmtime::component::TypedFunc::<1742(),1743(wasmtime::component::__internal::Vec<u64>,),1744>::new_unchecked(self.list_u64_ret)1745};1746let (ret0,) = callee.call(store.as_context_mut(), ())?;1747callee.post_return(store.as_context_mut())?;1748Ok(ret0)1749}1750pub fn call_list_s8_ret<S: wasmtime::AsContextMut>(1751&self,1752mut store: S,1753) -> wasmtime::Result<wasmtime::component::__internal::Vec<i8>> {1754let callee = unsafe {1755wasmtime::component::TypedFunc::<1756(),1757(wasmtime::component::__internal::Vec<i8>,),1758>::new_unchecked(self.list_s8_ret)1759};1760let (ret0,) = callee.call(store.as_context_mut(), ())?;1761callee.post_return(store.as_context_mut())?;1762Ok(ret0)1763}1764pub fn call_list_s16_ret<S: wasmtime::AsContextMut>(1765&self,1766mut store: S,1767) -> wasmtime::Result<wasmtime::component::__internal::Vec<i16>> {1768let callee = unsafe {1769wasmtime::component::TypedFunc::<1770(),1771(wasmtime::component::__internal::Vec<i16>,),1772>::new_unchecked(self.list_s16_ret)1773};1774let (ret0,) = callee.call(store.as_context_mut(), ())?;1775callee.post_return(store.as_context_mut())?;1776Ok(ret0)1777}1778pub fn call_list_s32_ret<S: wasmtime::AsContextMut>(1779&self,1780mut store: S,1781) -> wasmtime::Result<wasmtime::component::__internal::Vec<i32>> {1782let callee = unsafe {1783wasmtime::component::TypedFunc::<1784(),1785(wasmtime::component::__internal::Vec<i32>,),1786>::new_unchecked(self.list_s32_ret)1787};1788let (ret0,) = callee.call(store.as_context_mut(), ())?;1789callee.post_return(store.as_context_mut())?;1790Ok(ret0)1791}1792pub fn call_list_s64_ret<S: wasmtime::AsContextMut>(1793&self,1794mut store: S,1795) -> wasmtime::Result<wasmtime::component::__internal::Vec<i64>> {1796let callee = unsafe {1797wasmtime::component::TypedFunc::<1798(),1799(wasmtime::component::__internal::Vec<i64>,),1800>::new_unchecked(self.list_s64_ret)1801};1802let (ret0,) = callee.call(store.as_context_mut(), ())?;1803callee.post_return(store.as_context_mut())?;1804Ok(ret0)1805}1806pub fn call_list_f32_ret<S: wasmtime::AsContextMut>(1807&self,1808mut store: S,1809) -> wasmtime::Result<wasmtime::component::__internal::Vec<f32>> {1810let callee = unsafe {1811wasmtime::component::TypedFunc::<1812(),1813(wasmtime::component::__internal::Vec<f32>,),1814>::new_unchecked(self.list_f32_ret)1815};1816let (ret0,) = callee.call(store.as_context_mut(), ())?;1817callee.post_return(store.as_context_mut())?;1818Ok(ret0)1819}1820pub fn call_list_f64_ret<S: wasmtime::AsContextMut>(1821&self,1822mut store: S,1823) -> wasmtime::Result<wasmtime::component::__internal::Vec<f64>> {1824let callee = unsafe {1825wasmtime::component::TypedFunc::<1826(),1827(wasmtime::component::__internal::Vec<f64>,),1828>::new_unchecked(self.list_f64_ret)1829};1830let (ret0,) = callee.call(store.as_context_mut(), ())?;1831callee.post_return(store.as_context_mut())?;1832Ok(ret0)1833}1834pub fn call_tuple_list<S: wasmtime::AsContextMut>(1835&self,1836mut store: S,1837arg0: &[(u8, i8)],1838) -> wasmtime::Result<1839wasmtime::component::__internal::Vec<(i64, u32)>,1840> {1841let callee = unsafe {1842wasmtime::component::TypedFunc::<1843(&[(u8, i8)],),1844(wasmtime::component::__internal::Vec<(i64, u32)>,),1845>::new_unchecked(self.tuple_list)1846};1847let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;1848callee.post_return(store.as_context_mut())?;1849Ok(ret0)1850}1851pub fn call_string_list_arg<S: wasmtime::AsContextMut>(1852&self,1853mut store: S,1854arg0: &[wasmtime::component::__internal::String],1855) -> wasmtime::Result<()> {1856let callee = unsafe {1857wasmtime::component::TypedFunc::<1858(&[wasmtime::component::__internal::String],),1859(),1860>::new_unchecked(self.string_list_arg)1861};1862let () = callee.call(store.as_context_mut(), (arg0,))?;1863callee.post_return(store.as_context_mut())?;1864Ok(())1865}1866pub fn call_string_list_ret<S: wasmtime::AsContextMut>(1867&self,1868mut store: S,1869) -> wasmtime::Result<1870wasmtime::component::__internal::Vec<1871wasmtime::component::__internal::String,1872>,1873> {1874let callee = unsafe {1875wasmtime::component::TypedFunc::<1876(),1877(1878wasmtime::component::__internal::Vec<1879wasmtime::component::__internal::String,1880>,1881),1882>::new_unchecked(self.string_list_ret)1883};1884let (ret0,) = callee.call(store.as_context_mut(), ())?;1885callee.post_return(store.as_context_mut())?;1886Ok(ret0)1887}1888pub fn call_tuple_string_list<S: wasmtime::AsContextMut>(1889&self,1890mut store: S,1891arg0: &[(u8, wasmtime::component::__internal::String)],1892) -> wasmtime::Result<1893wasmtime::component::__internal::Vec<1894(wasmtime::component::__internal::String, u8),1895>,1896> {1897let callee = unsafe {1898wasmtime::component::TypedFunc::<1899(&[(u8, wasmtime::component::__internal::String)],),1900(1901wasmtime::component::__internal::Vec<1902(wasmtime::component::__internal::String, u8),1903>,1904),1905>::new_unchecked(self.tuple_string_list)1906};1907let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;1908callee.post_return(store.as_context_mut())?;1909Ok(ret0)1910}1911pub fn call_string_list<S: wasmtime::AsContextMut>(1912&self,1913mut store: S,1914arg0: &[wasmtime::component::__internal::String],1915) -> wasmtime::Result<1916wasmtime::component::__internal::Vec<1917wasmtime::component::__internal::String,1918>,1919> {1920let callee = unsafe {1921wasmtime::component::TypedFunc::<1922(&[wasmtime::component::__internal::String],),1923(1924wasmtime::component::__internal::Vec<1925wasmtime::component::__internal::String,1926>,1927),1928>::new_unchecked(self.string_list)1929};1930let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;1931callee.post_return(store.as_context_mut())?;1932Ok(ret0)1933}1934pub fn call_record_list<S: wasmtime::AsContextMut>(1935&self,1936mut store: S,1937arg0: &[SomeRecord],1938) -> wasmtime::Result<1939wasmtime::component::__internal::Vec<OtherRecord>,1940> {1941let callee = unsafe {1942wasmtime::component::TypedFunc::<1943(&[SomeRecord],),1944(wasmtime::component::__internal::Vec<OtherRecord>,),1945>::new_unchecked(self.record_list)1946};1947let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;1948callee.post_return(store.as_context_mut())?;1949Ok(ret0)1950}1951pub fn call_record_list_reverse<S: wasmtime::AsContextMut>(1952&self,1953mut store: S,1954arg0: &[OtherRecord],1955) -> wasmtime::Result<1956wasmtime::component::__internal::Vec<SomeRecord>,1957> {1958let callee = unsafe {1959wasmtime::component::TypedFunc::<1960(&[OtherRecord],),1961(wasmtime::component::__internal::Vec<SomeRecord>,),1962>::new_unchecked(self.record_list_reverse)1963};1964let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;1965callee.post_return(store.as_context_mut())?;1966Ok(ret0)1967}1968pub fn call_variant_list<S: wasmtime::AsContextMut>(1969&self,1970mut store: S,1971arg0: &[SomeVariant],1972) -> wasmtime::Result<1973wasmtime::component::__internal::Vec<OtherVariant>,1974> {1975let callee = unsafe {1976wasmtime::component::TypedFunc::<1977(&[SomeVariant],),1978(wasmtime::component::__internal::Vec<OtherVariant>,),1979>::new_unchecked(self.variant_list)1980};1981let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;1982callee.post_return(store.as_context_mut())?;1983Ok(ret0)1984}1985pub fn call_load_store_everything<S: wasmtime::AsContextMut>(1986&self,1987mut store: S,1988arg0: &LoadStoreAllSizes,1989) -> wasmtime::Result<LoadStoreAllSizes> {1990let callee = unsafe {1991wasmtime::component::TypedFunc::<1992(&LoadStoreAllSizes,),1993(LoadStoreAllSizes,),1994>::new_unchecked(self.load_store_everything)1995};1996let (ret0,) = callee.call(store.as_context_mut(), (arg0,))?;1997callee.post_return(store.as_context_mut())?;1998Ok(ret0)1999}2000}2001}2002}2003}2004}200520062007