Path: blob/main/crates/component-macro/tests/expanded/integers_async.rs
1692 views
/// Auto-generated bindings for a pre-instantiated version of a1/// component which implements the world `the-world`.2///3/// This structure is created through [`TheWorldPre::new`] which4/// takes a [`InstancePre`](wasmtime::component::InstancePre) that5/// has been created through a [`Linker`](wasmtime::component::Linker).6///7/// For more information see [`TheWorld`] as well.8pub struct TheWorldPre<T: 'static> {9instance_pre: wasmtime::component::InstancePre<T>,10indices: TheWorldIndices,11}12impl<T: 'static> Clone for TheWorldPre<T> {13fn clone(&self) -> Self {14Self {15instance_pre: self.instance_pre.clone(),16indices: self.indices.clone(),17}18}19}20impl<_T: 'static> TheWorldPre<_T> {21/// Creates a new copy of `TheWorldPre` 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 = TheWorldIndices::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 [`TheWorld`] 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<TheWorld> {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> TheWorldPre<_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<TheWorld> {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-world`.67///68/// This is an implementation detail of [`TheWorldPre`] and can69/// be constructed if needed as well.70///71/// For more information see [`TheWorld`] as well.72#[derive(Clone)]73pub struct TheWorldIndices {74interface0: exports::foo::foo::integers::GuestIndices,75}76/// Auto-generated bindings for an instance a component which77/// implements the world `the-world`.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/// [`TheWorld::instantiate`] which only needs a84/// [`Store`], [`Component`], and [`Linker`].85///86/// * Alternatively you can create a [`TheWorldPre`] ahead of87/// time with a [`Component`] to front-load string lookups88/// of exports once instead of per-instantiation. This89/// method then uses [`TheWorldPre::instantiate`] to90/// create a [`TheWorld`].91///92/// * If you've instantiated the instance yourself already93/// then you can use [`TheWorld::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 TheWorld {102interface0: exports::foo::foo::integers::Guest,103}104const _: () = {105#[allow(unused_imports)]106use wasmtime::component::__internal::anyhow;107impl TheWorldIndices {108/// Creates a new copy of `TheWorldIndices` 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::integers::GuestIndices::new(119_instance_pre,120)?;121Ok(TheWorldIndices { interface0 })122}123/// Uses the indices stored in `self` to load an instance124/// of [`TheWorld`] from the instance provided.125///126/// Note that at this time this method will additionally127/// perform type-checks of all exports.128pub fn load(129&self,130mut store: impl wasmtime::AsContextMut,131instance: &wasmtime::component::Instance,132) -> wasmtime::Result<TheWorld> {133let _ = &mut store;134let _instance = instance;135let interface0 = self.interface0.load(&mut store, &_instance)?;136Ok(TheWorld { interface0 })137}138}139impl TheWorld {140/// Convenience wrapper around [`TheWorldPre::new`] and141/// [`TheWorldPre::instantiate`].142pub fn instantiate<_T>(143store: impl wasmtime::AsContextMut<Data = _T>,144component: &wasmtime::component::Component,145linker: &wasmtime::component::Linker<_T>,146) -> wasmtime::Result<TheWorld> {147let pre = linker.instantiate_pre(component)?;148TheWorldPre::new(pre)?.instantiate(store)149}150/// Convenience wrapper around [`TheWorldIndices::new`] and151/// [`TheWorldIndices::load`].152pub fn new(153mut store: impl wasmtime::AsContextMut,154instance: &wasmtime::component::Instance,155) -> wasmtime::Result<TheWorld> {156let indices = TheWorldIndices::new(&instance.instance_pre(&store))?;157indices.load(&mut store, instance)158}159/// Convenience wrapper around [`TheWorldPre::new`] and160/// [`TheWorldPre::instantiate_async`].161pub async fn instantiate_async<_T>(162store: impl wasmtime::AsContextMut<Data = _T>,163component: &wasmtime::component::Component,164linker: &wasmtime::component::Linker<_T>,165) -> wasmtime::Result<TheWorld>166where167_T: Send,168{169let pre = linker.instantiate_pre(component)?;170TheWorldPre::new(pre)?.instantiate_async(store).await171}172pub fn add_to_linker<T, D>(173linker: &mut wasmtime::component::Linker<T>,174host_getter: fn(&mut T) -> D::Data<'_>,175) -> wasmtime::Result<()>176where177D: foo::foo::integers::HostWithStore + Send,178for<'a> D::Data<'a>: foo::foo::integers::Host + Send,179T: 'static + Send,180{181foo::foo::integers::add_to_linker::<T, D>(linker, host_getter)?;182Ok(())183}184pub fn foo_foo_integers(&self) -> &exports::foo::foo::integers::Guest {185&self.interface0186}187}188};189pub mod foo {190pub mod foo {191#[allow(clippy::all)]192pub mod integers {193#[allow(unused_imports)]194use wasmtime::component::__internal::{anyhow, Box};195pub trait HostWithStore: wasmtime::component::HasData + Send {}196impl<_T: ?Sized> HostWithStore for _T197where198_T: wasmtime::component::HasData + Send,199{}200pub trait Host: Send {201fn a1(202&mut self,203x: u8,204) -> impl ::core::future::Future<Output = ()> + Send;205fn a2(206&mut self,207x: i8,208) -> impl ::core::future::Future<Output = ()> + Send;209fn a3(210&mut self,211x: u16,212) -> impl ::core::future::Future<Output = ()> + Send;213fn a4(214&mut self,215x: i16,216) -> impl ::core::future::Future<Output = ()> + Send;217fn a5(218&mut self,219x: u32,220) -> impl ::core::future::Future<Output = ()> + Send;221fn a6(222&mut self,223x: i32,224) -> impl ::core::future::Future<Output = ()> + Send;225fn a7(226&mut self,227x: u64,228) -> impl ::core::future::Future<Output = ()> + Send;229fn a8(230&mut self,231x: i64,232) -> impl ::core::future::Future<Output = ()> + Send;233fn a9(234&mut self,235p1: u8,236p2: i8,237p3: u16,238p4: i16,239p5: u32,240p6: i32,241p7: u64,242p8: i64,243) -> impl ::core::future::Future<Output = ()> + Send;244fn r1(&mut self) -> impl ::core::future::Future<Output = u8> + Send;245fn r2(&mut self) -> impl ::core::future::Future<Output = i8> + Send;246fn r3(&mut self) -> impl ::core::future::Future<Output = u16> + Send;247fn r4(&mut self) -> impl ::core::future::Future<Output = i16> + Send;248fn r5(&mut self) -> impl ::core::future::Future<Output = u32> + Send;249fn r6(&mut self) -> impl ::core::future::Future<Output = i32> + Send;250fn r7(&mut self) -> impl ::core::future::Future<Output = u64> + Send;251fn r8(&mut self) -> impl ::core::future::Future<Output = i64> + Send;252fn pair_ret(253&mut self,254) -> impl ::core::future::Future<Output = (i64, u8)> + Send;255}256impl<_T: Host + ?Sized + Send> Host for &mut _T {257fn a1(258&mut self,259x: u8,260) -> impl ::core::future::Future<Output = ()> + Send {261async move { Host::a1(*self, x).await }262}263fn a2(264&mut self,265x: i8,266) -> impl ::core::future::Future<Output = ()> + Send {267async move { Host::a2(*self, x).await }268}269fn a3(270&mut self,271x: u16,272) -> impl ::core::future::Future<Output = ()> + Send {273async move { Host::a3(*self, x).await }274}275fn a4(276&mut self,277x: i16,278) -> impl ::core::future::Future<Output = ()> + Send {279async move { Host::a4(*self, x).await }280}281fn a5(282&mut self,283x: u32,284) -> impl ::core::future::Future<Output = ()> + Send {285async move { Host::a5(*self, x).await }286}287fn a6(288&mut self,289x: i32,290) -> impl ::core::future::Future<Output = ()> + Send {291async move { Host::a6(*self, x).await }292}293fn a7(294&mut self,295x: u64,296) -> impl ::core::future::Future<Output = ()> + Send {297async move { Host::a7(*self, x).await }298}299fn a8(300&mut self,301x: i64,302) -> impl ::core::future::Future<Output = ()> + Send {303async move { Host::a8(*self, x).await }304}305fn a9(306&mut self,307p1: u8,308p2: i8,309p3: u16,310p4: i16,311p5: u32,312p6: i32,313p7: u64,314p8: i64,315) -> impl ::core::future::Future<Output = ()> + Send {316async move { Host::a9(*self, p1, p2, p3, p4, p5, p6, p7, p8).await }317}318fn r1(&mut self) -> impl ::core::future::Future<Output = u8> + Send {319async move { Host::r1(*self).await }320}321fn r2(&mut self) -> impl ::core::future::Future<Output = i8> + Send {322async move { Host::r2(*self).await }323}324fn r3(&mut self) -> impl ::core::future::Future<Output = u16> + Send {325async move { Host::r3(*self).await }326}327fn r4(&mut self) -> impl ::core::future::Future<Output = i16> + Send {328async move { Host::r4(*self).await }329}330fn r5(&mut self) -> impl ::core::future::Future<Output = u32> + Send {331async move { Host::r5(*self).await }332}333fn r6(&mut self) -> impl ::core::future::Future<Output = i32> + Send {334async move { Host::r6(*self).await }335}336fn r7(&mut self) -> impl ::core::future::Future<Output = u64> + Send {337async move { Host::r7(*self).await }338}339fn r8(&mut self) -> impl ::core::future::Future<Output = i64> + Send {340async move { Host::r8(*self).await }341}342fn pair_ret(343&mut self,344) -> impl ::core::future::Future<Output = (i64, u8)> + Send {345async move { Host::pair_ret(*self).await }346}347}348pub fn add_to_linker<T, D>(349linker: &mut wasmtime::component::Linker<T>,350host_getter: fn(&mut T) -> D::Data<'_>,351) -> wasmtime::Result<()>352where353D: HostWithStore,354for<'a> D::Data<'a>: Host,355T: 'static + Send,356{357let mut inst = linker.instance("foo:foo/integers")?;358inst.func_wrap_async(359"a1",360move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (u8,)| {361wasmtime::component::__internal::Box::new(async move {362let host = &mut host_getter(caller.data_mut());363let r = Host::a1(host, arg0).await;364Ok(r)365})366},367)?;368inst.func_wrap_async(369"a2",370move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (i8,)| {371wasmtime::component::__internal::Box::new(async move {372let host = &mut host_getter(caller.data_mut());373let r = Host::a2(host, arg0).await;374Ok(r)375})376},377)?;378inst.func_wrap_async(379"a3",380move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (u16,)| {381wasmtime::component::__internal::Box::new(async move {382let host = &mut host_getter(caller.data_mut());383let r = Host::a3(host, arg0).await;384Ok(r)385})386},387)?;388inst.func_wrap_async(389"a4",390move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (i16,)| {391wasmtime::component::__internal::Box::new(async move {392let host = &mut host_getter(caller.data_mut());393let r = Host::a4(host, arg0).await;394Ok(r)395})396},397)?;398inst.func_wrap_async(399"a5",400move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (u32,)| {401wasmtime::component::__internal::Box::new(async move {402let host = &mut host_getter(caller.data_mut());403let r = Host::a5(host, arg0).await;404Ok(r)405})406},407)?;408inst.func_wrap_async(409"a6",410move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (i32,)| {411wasmtime::component::__internal::Box::new(async move {412let host = &mut host_getter(caller.data_mut());413let r = Host::a6(host, arg0).await;414Ok(r)415})416},417)?;418inst.func_wrap_async(419"a7",420move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (u64,)| {421wasmtime::component::__internal::Box::new(async move {422let host = &mut host_getter(caller.data_mut());423let r = Host::a7(host, arg0).await;424Ok(r)425})426},427)?;428inst.func_wrap_async(429"a8",430move |mut caller: wasmtime::StoreContextMut<'_, T>, (arg0,): (i64,)| {431wasmtime::component::__internal::Box::new(async move {432let host = &mut host_getter(caller.data_mut());433let r = Host::a8(host, arg0).await;434Ok(r)435})436},437)?;438inst.func_wrap_async(439"a9",440move |441mut caller: wasmtime::StoreContextMut<'_, T>,442(443arg0,444arg1,445arg2,446arg3,447arg4,448arg5,449arg6,450arg7,451): (u8, i8, u16, i16, u32, i32, u64, i64)|452{453wasmtime::component::__internal::Box::new(async move {454let host = &mut host_getter(caller.data_mut());455let r = Host::a9(456host,457arg0,458arg1,459arg2,460arg3,461arg4,462arg5,463arg6,464arg7,465)466.await;467Ok(r)468})469},470)?;471inst.func_wrap_async(472"r1",473move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {474wasmtime::component::__internal::Box::new(async move {475let host = &mut host_getter(caller.data_mut());476let r = Host::r1(host).await;477Ok((r,))478})479},480)?;481inst.func_wrap_async(482"r2",483move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {484wasmtime::component::__internal::Box::new(async move {485let host = &mut host_getter(caller.data_mut());486let r = Host::r2(host).await;487Ok((r,))488})489},490)?;491inst.func_wrap_async(492"r3",493move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {494wasmtime::component::__internal::Box::new(async move {495let host = &mut host_getter(caller.data_mut());496let r = Host::r3(host).await;497Ok((r,))498})499},500)?;501inst.func_wrap_async(502"r4",503move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {504wasmtime::component::__internal::Box::new(async move {505let host = &mut host_getter(caller.data_mut());506let r = Host::r4(host).await;507Ok((r,))508})509},510)?;511inst.func_wrap_async(512"r5",513move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {514wasmtime::component::__internal::Box::new(async move {515let host = &mut host_getter(caller.data_mut());516let r = Host::r5(host).await;517Ok((r,))518})519},520)?;521inst.func_wrap_async(522"r6",523move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {524wasmtime::component::__internal::Box::new(async move {525let host = &mut host_getter(caller.data_mut());526let r = Host::r6(host).await;527Ok((r,))528})529},530)?;531inst.func_wrap_async(532"r7",533move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {534wasmtime::component::__internal::Box::new(async move {535let host = &mut host_getter(caller.data_mut());536let r = Host::r7(host).await;537Ok((r,))538})539},540)?;541inst.func_wrap_async(542"r8",543move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {544wasmtime::component::__internal::Box::new(async move {545let host = &mut host_getter(caller.data_mut());546let r = Host::r8(host).await;547Ok((r,))548})549},550)?;551inst.func_wrap_async(552"pair-ret",553move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {554wasmtime::component::__internal::Box::new(async move {555let host = &mut host_getter(caller.data_mut());556let r = Host::pair_ret(host).await;557Ok((r,))558})559},560)?;561Ok(())562}563}564}565}566pub mod exports {567pub mod foo {568pub mod foo {569#[allow(clippy::all)]570pub mod integers {571#[allow(unused_imports)]572use wasmtime::component::__internal::{anyhow, Box};573pub struct Guest {574a1: wasmtime::component::Func,575a2: wasmtime::component::Func,576a3: wasmtime::component::Func,577a4: wasmtime::component::Func,578a5: wasmtime::component::Func,579a6: wasmtime::component::Func,580a7: wasmtime::component::Func,581a8: wasmtime::component::Func,582a9: wasmtime::component::Func,583r1: wasmtime::component::Func,584r2: wasmtime::component::Func,585r3: wasmtime::component::Func,586r4: wasmtime::component::Func,587r5: wasmtime::component::Func,588r6: wasmtime::component::Func,589r7: wasmtime::component::Func,590r8: wasmtime::component::Func,591pair_ret: wasmtime::component::Func,592}593#[derive(Clone)]594pub struct GuestIndices {595a1: wasmtime::component::ComponentExportIndex,596a2: wasmtime::component::ComponentExportIndex,597a3: wasmtime::component::ComponentExportIndex,598a4: wasmtime::component::ComponentExportIndex,599a5: wasmtime::component::ComponentExportIndex,600a6: wasmtime::component::ComponentExportIndex,601a7: wasmtime::component::ComponentExportIndex,602a8: wasmtime::component::ComponentExportIndex,603a9: wasmtime::component::ComponentExportIndex,604r1: wasmtime::component::ComponentExportIndex,605r2: wasmtime::component::ComponentExportIndex,606r3: wasmtime::component::ComponentExportIndex,607r4: wasmtime::component::ComponentExportIndex,608r5: wasmtime::component::ComponentExportIndex,609r6: wasmtime::component::ComponentExportIndex,610r7: wasmtime::component::ComponentExportIndex,611r8: wasmtime::component::ComponentExportIndex,612pair_ret: wasmtime::component::ComponentExportIndex,613}614impl GuestIndices {615/// Constructor for [`GuestIndices`] which takes a616/// [`Component`](wasmtime::component::Component) as input and can be executed617/// before instantiation.618///619/// This constructor can be used to front-load string lookups to find exports620/// within a component.621pub fn new<_T>(622_instance_pre: &wasmtime::component::InstancePre<_T>,623) -> wasmtime::Result<GuestIndices> {624let instance = _instance_pre625.component()626.get_export_index(None, "foo:foo/integers")627.ok_or_else(|| {628anyhow::anyhow!(629"no exported instance named `foo:foo/integers`"630)631})?;632let mut lookup = move |name| {633_instance_pre634.component()635.get_export_index(Some(&instance), name)636.ok_or_else(|| {637anyhow::anyhow!(638"instance export `foo:foo/integers` does \639not have export `{name}`"640)641})642};643let _ = &mut lookup;644let a1 = lookup("a1")?;645let a2 = lookup("a2")?;646let a3 = lookup("a3")?;647let a4 = lookup("a4")?;648let a5 = lookup("a5")?;649let a6 = lookup("a6")?;650let a7 = lookup("a7")?;651let a8 = lookup("a8")?;652let a9 = lookup("a9")?;653let r1 = lookup("r1")?;654let r2 = lookup("r2")?;655let r3 = lookup("r3")?;656let r4 = lookup("r4")?;657let r5 = lookup("r5")?;658let r6 = lookup("r6")?;659let r7 = lookup("r7")?;660let r8 = lookup("r8")?;661let pair_ret = lookup("pair-ret")?;662Ok(GuestIndices {663a1,664a2,665a3,666a4,667a5,668a6,669a7,670a8,671a9,672r1,673r2,674r3,675r4,676r5,677r6,678r7,679r8,680pair_ret,681})682}683pub fn load(684&self,685mut store: impl wasmtime::AsContextMut,686instance: &wasmtime::component::Instance,687) -> wasmtime::Result<Guest> {688let _instance = instance;689let _instance_pre = _instance.instance_pre(&store);690let _instance_type = _instance_pre.instance_type();691let mut store = store.as_context_mut();692let _ = &mut store;693let a1 = *_instance694.get_typed_func::<(u8,), ()>(&mut store, &self.a1)?695.func();696let a2 = *_instance697.get_typed_func::<(i8,), ()>(&mut store, &self.a2)?698.func();699let a3 = *_instance700.get_typed_func::<(u16,), ()>(&mut store, &self.a3)?701.func();702let a4 = *_instance703.get_typed_func::<(i16,), ()>(&mut store, &self.a4)?704.func();705let a5 = *_instance706.get_typed_func::<(u32,), ()>(&mut store, &self.a5)?707.func();708let a6 = *_instance709.get_typed_func::<(i32,), ()>(&mut store, &self.a6)?710.func();711let a7 = *_instance712.get_typed_func::<(u64,), ()>(&mut store, &self.a7)?713.func();714let a8 = *_instance715.get_typed_func::<(i64,), ()>(&mut store, &self.a8)?716.func();717let a9 = *_instance718.get_typed_func::<719(u8, i8, u16, i16, u32, i32, u64, i64),720(),721>(&mut store, &self.a9)?722.func();723let r1 = *_instance724.get_typed_func::<(), (u8,)>(&mut store, &self.r1)?725.func();726let r2 = *_instance727.get_typed_func::<(), (i8,)>(&mut store, &self.r2)?728.func();729let r3 = *_instance730.get_typed_func::<(), (u16,)>(&mut store, &self.r3)?731.func();732let r4 = *_instance733.get_typed_func::<(), (i16,)>(&mut store, &self.r4)?734.func();735let r5 = *_instance736.get_typed_func::<(), (u32,)>(&mut store, &self.r5)?737.func();738let r6 = *_instance739.get_typed_func::<(), (i32,)>(&mut store, &self.r6)?740.func();741let r7 = *_instance742.get_typed_func::<(), (u64,)>(&mut store, &self.r7)?743.func();744let r8 = *_instance745.get_typed_func::<(), (i64,)>(&mut store, &self.r8)?746.func();747let pair_ret = *_instance748.get_typed_func::<749(),750((i64, u8),),751>(&mut store, &self.pair_ret)?752.func();753Ok(Guest {754a1,755a2,756a3,757a4,758a5,759a6,760a7,761a8,762a9,763r1,764r2,765r3,766r4,767r5,768r6,769r7,770r8,771pair_ret,772})773}774}775impl Guest {776pub async fn call_a1<S: wasmtime::AsContextMut>(777&self,778mut store: S,779arg0: u8,780) -> wasmtime::Result<()>781where782<S as wasmtime::AsContext>::Data: Send,783{784let callee = unsafe {785wasmtime::component::TypedFunc::<786(u8,),787(),788>::new_unchecked(self.a1)789};790let () = callee791.call_async(store.as_context_mut(), (arg0,))792.await?;793callee.post_return_async(store.as_context_mut()).await?;794Ok(())795}796pub async fn call_a2<S: wasmtime::AsContextMut>(797&self,798mut store: S,799arg0: i8,800) -> wasmtime::Result<()>801where802<S as wasmtime::AsContext>::Data: Send,803{804let callee = unsafe {805wasmtime::component::TypedFunc::<806(i8,),807(),808>::new_unchecked(self.a2)809};810let () = callee811.call_async(store.as_context_mut(), (arg0,))812.await?;813callee.post_return_async(store.as_context_mut()).await?;814Ok(())815}816pub async fn call_a3<S: wasmtime::AsContextMut>(817&self,818mut store: S,819arg0: u16,820) -> wasmtime::Result<()>821where822<S as wasmtime::AsContext>::Data: Send,823{824let callee = unsafe {825wasmtime::component::TypedFunc::<826(u16,),827(),828>::new_unchecked(self.a3)829};830let () = callee831.call_async(store.as_context_mut(), (arg0,))832.await?;833callee.post_return_async(store.as_context_mut()).await?;834Ok(())835}836pub async fn call_a4<S: wasmtime::AsContextMut>(837&self,838mut store: S,839arg0: i16,840) -> wasmtime::Result<()>841where842<S as wasmtime::AsContext>::Data: Send,843{844let callee = unsafe {845wasmtime::component::TypedFunc::<846(i16,),847(),848>::new_unchecked(self.a4)849};850let () = callee851.call_async(store.as_context_mut(), (arg0,))852.await?;853callee.post_return_async(store.as_context_mut()).await?;854Ok(())855}856pub async fn call_a5<S: wasmtime::AsContextMut>(857&self,858mut store: S,859arg0: u32,860) -> wasmtime::Result<()>861where862<S as wasmtime::AsContext>::Data: Send,863{864let callee = unsafe {865wasmtime::component::TypedFunc::<866(u32,),867(),868>::new_unchecked(self.a5)869};870let () = callee871.call_async(store.as_context_mut(), (arg0,))872.await?;873callee.post_return_async(store.as_context_mut()).await?;874Ok(())875}876pub async fn call_a6<S: wasmtime::AsContextMut>(877&self,878mut store: S,879arg0: i32,880) -> wasmtime::Result<()>881where882<S as wasmtime::AsContext>::Data: Send,883{884let callee = unsafe {885wasmtime::component::TypedFunc::<886(i32,),887(),888>::new_unchecked(self.a6)889};890let () = callee891.call_async(store.as_context_mut(), (arg0,))892.await?;893callee.post_return_async(store.as_context_mut()).await?;894Ok(())895}896pub async fn call_a7<S: wasmtime::AsContextMut>(897&self,898mut store: S,899arg0: u64,900) -> wasmtime::Result<()>901where902<S as wasmtime::AsContext>::Data: Send,903{904let callee = unsafe {905wasmtime::component::TypedFunc::<906(u64,),907(),908>::new_unchecked(self.a7)909};910let () = callee911.call_async(store.as_context_mut(), (arg0,))912.await?;913callee.post_return_async(store.as_context_mut()).await?;914Ok(())915}916pub async fn call_a8<S: wasmtime::AsContextMut>(917&self,918mut store: S,919arg0: i64,920) -> wasmtime::Result<()>921where922<S as wasmtime::AsContext>::Data: Send,923{924let callee = unsafe {925wasmtime::component::TypedFunc::<926(i64,),927(),928>::new_unchecked(self.a8)929};930let () = callee931.call_async(store.as_context_mut(), (arg0,))932.await?;933callee.post_return_async(store.as_context_mut()).await?;934Ok(())935}936pub async fn call_a9<S: wasmtime::AsContextMut>(937&self,938mut store: S,939arg0: u8,940arg1: i8,941arg2: u16,942arg3: i16,943arg4: u32,944arg5: i32,945arg6: u64,946arg7: i64,947) -> wasmtime::Result<()>948where949<S as wasmtime::AsContext>::Data: Send,950{951let callee = unsafe {952wasmtime::component::TypedFunc::<953(u8, i8, u16, i16, u32, i32, u64, i64),954(),955>::new_unchecked(self.a9)956};957let () = callee958.call_async(959store.as_context_mut(),960(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7),961)962.await?;963callee.post_return_async(store.as_context_mut()).await?;964Ok(())965}966pub async fn call_r1<S: wasmtime::AsContextMut>(967&self,968mut store: S,969) -> wasmtime::Result<u8>970where971<S as wasmtime::AsContext>::Data: Send,972{973let callee = unsafe {974wasmtime::component::TypedFunc::<975(),976(u8,),977>::new_unchecked(self.r1)978};979let (ret0,) = callee980.call_async(store.as_context_mut(), ())981.await?;982callee.post_return_async(store.as_context_mut()).await?;983Ok(ret0)984}985pub async fn call_r2<S: wasmtime::AsContextMut>(986&self,987mut store: S,988) -> wasmtime::Result<i8>989where990<S as wasmtime::AsContext>::Data: Send,991{992let callee = unsafe {993wasmtime::component::TypedFunc::<994(),995(i8,),996>::new_unchecked(self.r2)997};998let (ret0,) = callee999.call_async(store.as_context_mut(), ())1000.await?;1001callee.post_return_async(store.as_context_mut()).await?;1002Ok(ret0)1003}1004pub async fn call_r3<S: wasmtime::AsContextMut>(1005&self,1006mut store: S,1007) -> wasmtime::Result<u16>1008where1009<S as wasmtime::AsContext>::Data: Send,1010{1011let callee = unsafe {1012wasmtime::component::TypedFunc::<1013(),1014(u16,),1015>::new_unchecked(self.r3)1016};1017let (ret0,) = callee1018.call_async(store.as_context_mut(), ())1019.await?;1020callee.post_return_async(store.as_context_mut()).await?;1021Ok(ret0)1022}1023pub async fn call_r4<S: wasmtime::AsContextMut>(1024&self,1025mut store: S,1026) -> wasmtime::Result<i16>1027where1028<S as wasmtime::AsContext>::Data: Send,1029{1030let callee = unsafe {1031wasmtime::component::TypedFunc::<1032(),1033(i16,),1034>::new_unchecked(self.r4)1035};1036let (ret0,) = callee1037.call_async(store.as_context_mut(), ())1038.await?;1039callee.post_return_async(store.as_context_mut()).await?;1040Ok(ret0)1041}1042pub async fn call_r5<S: wasmtime::AsContextMut>(1043&self,1044mut store: S,1045) -> wasmtime::Result<u32>1046where1047<S as wasmtime::AsContext>::Data: Send,1048{1049let callee = unsafe {1050wasmtime::component::TypedFunc::<1051(),1052(u32,),1053>::new_unchecked(self.r5)1054};1055let (ret0,) = callee1056.call_async(store.as_context_mut(), ())1057.await?;1058callee.post_return_async(store.as_context_mut()).await?;1059Ok(ret0)1060}1061pub async fn call_r6<S: wasmtime::AsContextMut>(1062&self,1063mut store: S,1064) -> wasmtime::Result<i32>1065where1066<S as wasmtime::AsContext>::Data: Send,1067{1068let callee = unsafe {1069wasmtime::component::TypedFunc::<1070(),1071(i32,),1072>::new_unchecked(self.r6)1073};1074let (ret0,) = callee1075.call_async(store.as_context_mut(), ())1076.await?;1077callee.post_return_async(store.as_context_mut()).await?;1078Ok(ret0)1079}1080pub async fn call_r7<S: wasmtime::AsContextMut>(1081&self,1082mut store: S,1083) -> wasmtime::Result<u64>1084where1085<S as wasmtime::AsContext>::Data: Send,1086{1087let callee = unsafe {1088wasmtime::component::TypedFunc::<1089(),1090(u64,),1091>::new_unchecked(self.r7)1092};1093let (ret0,) = callee1094.call_async(store.as_context_mut(), ())1095.await?;1096callee.post_return_async(store.as_context_mut()).await?;1097Ok(ret0)1098}1099pub async fn call_r8<S: wasmtime::AsContextMut>(1100&self,1101mut store: S,1102) -> wasmtime::Result<i64>1103where1104<S as wasmtime::AsContext>::Data: Send,1105{1106let callee = unsafe {1107wasmtime::component::TypedFunc::<1108(),1109(i64,),1110>::new_unchecked(self.r8)1111};1112let (ret0,) = callee1113.call_async(store.as_context_mut(), ())1114.await?;1115callee.post_return_async(store.as_context_mut()).await?;1116Ok(ret0)1117}1118pub async fn call_pair_ret<S: wasmtime::AsContextMut>(1119&self,1120mut store: S,1121) -> wasmtime::Result<(i64, u8)>1122where1123<S as wasmtime::AsContext>::Data: Send,1124{1125let callee = unsafe {1126wasmtime::component::TypedFunc::<1127(),1128((i64, u8),),1129>::new_unchecked(self.pair_ret)1130};1131let (ret0,) = callee1132.call_async(store.as_context_mut(), ())1133.await?;1134callee.post_return_async(store.as_context_mut()).await?;1135Ok(ret0)1136}1137}1138}1139}1140}1141}114211431144