Path: blob/main/crates/component-macro/tests/expanded/conventions_async.rs
3073 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::conventions::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::conventions::Guest,103}104const _: () = {105impl TheWorldIndices {106/// Creates a new copy of `TheWorldIndices` 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::conventions::GuestIndices::new(117_instance_pre,118)?;119Ok(TheWorldIndices { interface0 })120}121/// Uses the indices stored in `self` to load an instance122/// of [`TheWorld`] 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<TheWorld> {131let _ = &mut store;132let _instance = instance;133let interface0 = self.interface0.load(&mut store, &_instance)?;134Ok(TheWorld { interface0 })135}136}137impl TheWorld {138/// Convenience wrapper around [`TheWorldPre::new`] and139/// [`TheWorldPre::instantiate`].140pub fn instantiate<_T>(141store: impl wasmtime::AsContextMut<Data = _T>,142component: &wasmtime::component::Component,143linker: &wasmtime::component::Linker<_T>,144) -> wasmtime::Result<TheWorld> {145let pre = linker.instantiate_pre(component)?;146TheWorldPre::new(pre)?.instantiate(store)147}148/// Convenience wrapper around [`TheWorldIndices::new`] and149/// [`TheWorldIndices::load`].150pub fn new(151mut store: impl wasmtime::AsContextMut,152instance: &wasmtime::component::Instance,153) -> wasmtime::Result<TheWorld> {154let indices = TheWorldIndices::new(&instance.instance_pre(&store))?;155indices.load(&mut store, instance)156}157/// Convenience wrapper around [`TheWorldPre::new`] and158/// [`TheWorldPre::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<TheWorld>164where165_T: Send,166{167let pre = linker.instantiate_pre(component)?;168TheWorldPre::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::conventions::HostWithStore + Send,176for<'a> D::Data<'a>: foo::foo::conventions::Host + Send,177T: 'static + Send,178{179foo::foo::conventions::add_to_linker::<T, D>(linker, host_getter)?;180Ok(())181}182pub fn foo_foo_conventions(&self) -> &exports::foo::foo::conventions::Guest {183&self.interface0184}185}186};187pub mod foo {188pub mod foo {189#[allow(clippy::all)]190pub mod conventions {191#[allow(unused_imports)]192use wasmtime::component::__internal::Box;193#[derive(wasmtime::component::ComponentType)]194#[derive(wasmtime::component::Lift)]195#[derive(wasmtime::component::Lower)]196#[component(record)]197#[derive(Clone, Copy)]198pub struct LudicrousSpeed {199#[component(name = "how-fast-are-you-going")]200pub how_fast_are_you_going: u32,201#[component(name = "i-am-going-extremely-slow")]202pub i_am_going_extremely_slow: u64,203}204impl core::fmt::Debug for LudicrousSpeed {205fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {206f.debug_struct("LudicrousSpeed")207.field("how-fast-are-you-going", &self.how_fast_are_you_going)208.field(209"i-am-going-extremely-slow",210&self.i_am_going_extremely_slow,211)212.finish()213}214}215const _: () = {216assert!(21716 == < LudicrousSpeed as wasmtime::component::ComponentType218>::SIZE32219);220assert!(2218 == < LudicrousSpeed as wasmtime::component::ComponentType222>::ALIGN32223);224};225pub trait HostWithStore: wasmtime::component::HasData + Send {}226impl<_T: ?Sized> HostWithStore for _T227where228_T: wasmtime::component::HasData + Send,229{}230pub trait Host: Send {231fn kebab_case(232&mut self,233) -> impl ::core::future::Future<Output = ()> + Send;234fn foo(235&mut self,236x: LudicrousSpeed,237) -> impl ::core::future::Future<Output = ()> + Send;238fn function_with_dashes(239&mut self,240) -> impl ::core::future::Future<Output = ()> + Send;241fn function_with_no_weird_characters(242&mut self,243) -> impl ::core::future::Future<Output = ()> + Send;244fn apple(&mut self) -> impl ::core::future::Future<Output = ()> + Send;245fn apple_pear(246&mut self,247) -> impl ::core::future::Future<Output = ()> + Send;248fn apple_pear_grape(249&mut self,250) -> impl ::core::future::Future<Output = ()> + Send;251fn a0(&mut self) -> impl ::core::future::Future<Output = ()> + Send;252/// Comment out identifiers that collide when mapped to snake_case, for now; see253/// https://github.com/WebAssembly/component-model/issues/118254/// APPLE: func()255/// APPLE-pear-GRAPE: func()256/// apple-PEAR-grape: func()257fn is_xml(&mut self) -> impl ::core::future::Future<Output = ()> + Send;258fn explicit(259&mut self,260) -> impl ::core::future::Future<Output = ()> + Send;261fn explicit_kebab(262&mut self,263) -> impl ::core::future::Future<Output = ()> + Send;264/// Identifiers with the same name as keywords are quoted.265fn bool(&mut self) -> impl ::core::future::Future<Output = ()> + Send;266}267impl<_T: Host + ?Sized + Send> Host for &mut _T {268fn kebab_case(269&mut self,270) -> impl ::core::future::Future<Output = ()> + Send {271async move { Host::kebab_case(*self).await }272}273fn foo(274&mut self,275x: LudicrousSpeed,276) -> impl ::core::future::Future<Output = ()> + Send {277async move { Host::foo(*self, x).await }278}279fn function_with_dashes(280&mut self,281) -> impl ::core::future::Future<Output = ()> + Send {282async move { Host::function_with_dashes(*self).await }283}284fn function_with_no_weird_characters(285&mut self,286) -> impl ::core::future::Future<Output = ()> + Send {287async move { Host::function_with_no_weird_characters(*self).await }288}289fn apple(&mut self) -> impl ::core::future::Future<Output = ()> + Send {290async move { Host::apple(*self).await }291}292fn apple_pear(293&mut self,294) -> impl ::core::future::Future<Output = ()> + Send {295async move { Host::apple_pear(*self).await }296}297fn apple_pear_grape(298&mut self,299) -> impl ::core::future::Future<Output = ()> + Send {300async move { Host::apple_pear_grape(*self).await }301}302fn a0(&mut self) -> impl ::core::future::Future<Output = ()> + Send {303async move { Host::a0(*self).await }304}305/// Comment out identifiers that collide when mapped to snake_case, for now; see306/// https://github.com/WebAssembly/component-model/issues/118307/// APPLE: func()308/// APPLE-pear-GRAPE: func()309/// apple-PEAR-grape: func()310fn is_xml(&mut self) -> impl ::core::future::Future<Output = ()> + Send {311async move { Host::is_xml(*self).await }312}313fn explicit(314&mut self,315) -> impl ::core::future::Future<Output = ()> + Send {316async move { Host::explicit(*self).await }317}318fn explicit_kebab(319&mut self,320) -> impl ::core::future::Future<Output = ()> + Send {321async move { Host::explicit_kebab(*self).await }322}323/// Identifiers with the same name as keywords are quoted.324fn bool(&mut self) -> impl ::core::future::Future<Output = ()> + Send {325async move { Host::bool(*self).await }326}327}328pub fn add_to_linker<T, D>(329linker: &mut wasmtime::component::Linker<T>,330host_getter: fn(&mut T) -> D::Data<'_>,331) -> wasmtime::Result<()>332where333D: HostWithStore,334for<'a> D::Data<'a>: Host,335T: 'static + Send,336{337let mut inst = linker.instance("foo:foo/conventions")?;338inst.func_wrap_async(339"kebab-case",340move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {341wasmtime::component::__internal::Box::new(async move {342let host = &mut host_getter(caller.data_mut());343let r = Host::kebab_case(host).await;344Ok(r)345})346},347)?;348inst.func_wrap_async(349"foo",350move |351mut caller: wasmtime::StoreContextMut<'_, T>,352(arg0,): (LudicrousSpeed,)|353{354wasmtime::component::__internal::Box::new(async move {355let host = &mut host_getter(caller.data_mut());356let r = Host::foo(host, arg0).await;357Ok(r)358})359},360)?;361inst.func_wrap_async(362"function-with-dashes",363move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {364wasmtime::component::__internal::Box::new(async move {365let host = &mut host_getter(caller.data_mut());366let r = Host::function_with_dashes(host).await;367Ok(r)368})369},370)?;371inst.func_wrap_async(372"function-with-no-weird-characters",373move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {374wasmtime::component::__internal::Box::new(async move {375let host = &mut host_getter(caller.data_mut());376let r = Host::function_with_no_weird_characters(host).await;377Ok(r)378})379},380)?;381inst.func_wrap_async(382"apple",383move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {384wasmtime::component::__internal::Box::new(async move {385let host = &mut host_getter(caller.data_mut());386let r = Host::apple(host).await;387Ok(r)388})389},390)?;391inst.func_wrap_async(392"apple-pear",393move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {394wasmtime::component::__internal::Box::new(async move {395let host = &mut host_getter(caller.data_mut());396let r = Host::apple_pear(host).await;397Ok(r)398})399},400)?;401inst.func_wrap_async(402"apple-pear-grape",403move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {404wasmtime::component::__internal::Box::new(async move {405let host = &mut host_getter(caller.data_mut());406let r = Host::apple_pear_grape(host).await;407Ok(r)408})409},410)?;411inst.func_wrap_async(412"a0",413move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {414wasmtime::component::__internal::Box::new(async move {415let host = &mut host_getter(caller.data_mut());416let r = Host::a0(host).await;417Ok(r)418})419},420)?;421inst.func_wrap_async(422"is-XML",423move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {424wasmtime::component::__internal::Box::new(async move {425let host = &mut host_getter(caller.data_mut());426let r = Host::is_xml(host).await;427Ok(r)428})429},430)?;431inst.func_wrap_async(432"explicit",433move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {434wasmtime::component::__internal::Box::new(async move {435let host = &mut host_getter(caller.data_mut());436let r = Host::explicit(host).await;437Ok(r)438})439},440)?;441inst.func_wrap_async(442"explicit-kebab",443move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {444wasmtime::component::__internal::Box::new(async move {445let host = &mut host_getter(caller.data_mut());446let r = Host::explicit_kebab(host).await;447Ok(r)448})449},450)?;451inst.func_wrap_async(452"bool",453move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {454wasmtime::component::__internal::Box::new(async move {455let host = &mut host_getter(caller.data_mut());456let r = Host::bool(host).await;457Ok(r)458})459},460)?;461Ok(())462}463}464}465}466pub mod exports {467pub mod foo {468pub mod foo {469#[allow(clippy::all)]470pub mod conventions {471#[allow(unused_imports)]472use wasmtime::component::__internal::Box;473#[derive(wasmtime::component::ComponentType)]474#[derive(wasmtime::component::Lift)]475#[derive(wasmtime::component::Lower)]476#[component(record)]477#[derive(Clone, Copy)]478pub struct LudicrousSpeed {479#[component(name = "how-fast-are-you-going")]480pub how_fast_are_you_going: u32,481#[component(name = "i-am-going-extremely-slow")]482pub i_am_going_extremely_slow: u64,483}484impl core::fmt::Debug for LudicrousSpeed {485fn fmt(486&self,487f: &mut core::fmt::Formatter<'_>,488) -> core::fmt::Result {489f.debug_struct("LudicrousSpeed")490.field(491"how-fast-are-you-going",492&self.how_fast_are_you_going,493)494.field(495"i-am-going-extremely-slow",496&self.i_am_going_extremely_slow,497)498.finish()499}500}501const _: () = {502assert!(50316 == < LudicrousSpeed as wasmtime::component::ComponentType504>::SIZE32505);506assert!(5078 == < LudicrousSpeed as wasmtime::component::ComponentType508>::ALIGN32509);510};511#[derive(Clone)]512pub struct Guest {513kebab_case: wasmtime::component::Func,514foo: wasmtime::component::Func,515function_with_dashes: wasmtime::component::Func,516function_with_no_weird_characters: wasmtime::component::Func,517apple: wasmtime::component::Func,518apple_pear: wasmtime::component::Func,519apple_pear_grape: wasmtime::component::Func,520a0: wasmtime::component::Func,521is_xml: wasmtime::component::Func,522explicit: wasmtime::component::Func,523explicit_kebab: wasmtime::component::Func,524bool: wasmtime::component::Func,525}526#[derive(Clone)]527pub struct GuestIndices {528kebab_case: wasmtime::component::ComponentExportIndex,529foo: wasmtime::component::ComponentExportIndex,530function_with_dashes: wasmtime::component::ComponentExportIndex,531function_with_no_weird_characters: wasmtime::component::ComponentExportIndex,532apple: wasmtime::component::ComponentExportIndex,533apple_pear: wasmtime::component::ComponentExportIndex,534apple_pear_grape: wasmtime::component::ComponentExportIndex,535a0: wasmtime::component::ComponentExportIndex,536is_xml: wasmtime::component::ComponentExportIndex,537explicit: wasmtime::component::ComponentExportIndex,538explicit_kebab: wasmtime::component::ComponentExportIndex,539bool: wasmtime::component::ComponentExportIndex,540}541impl GuestIndices {542/// Constructor for [`GuestIndices`] which takes a543/// [`Component`](wasmtime::component::Component) as input and can be executed544/// before instantiation.545///546/// This constructor can be used to front-load string lookups to find exports547/// within a component.548pub fn new<_T>(549_instance_pre: &wasmtime::component::InstancePre<_T>,550) -> wasmtime::Result<GuestIndices> {551let instance = _instance_pre552.component()553.get_export_index(None, "foo:foo/conventions")554.ok_or_else(|| {555wasmtime::format_err!(556"no exported instance named `foo:foo/conventions`"557)558})?;559let mut lookup = move |name| {560_instance_pre561.component()562.get_export_index(Some(&instance), name)563.ok_or_else(|| {564wasmtime::format_err!(565"instance export `foo:foo/conventions` does \566not have export `{name}`"567)568})569};570let _ = &mut lookup;571let kebab_case = lookup("kebab-case")?;572let foo = lookup("foo")?;573let function_with_dashes = lookup("function-with-dashes")?;574let function_with_no_weird_characters = lookup(575"function-with-no-weird-characters",576)?;577let apple = lookup("apple")?;578let apple_pear = lookup("apple-pear")?;579let apple_pear_grape = lookup("apple-pear-grape")?;580let a0 = lookup("a0")?;581let is_xml = lookup("is-XML")?;582let explicit = lookup("explicit")?;583let explicit_kebab = lookup("explicit-kebab")?;584let bool = lookup("bool")?;585Ok(GuestIndices {586kebab_case,587foo,588function_with_dashes,589function_with_no_weird_characters,590apple,591apple_pear,592apple_pear_grape,593a0,594is_xml,595explicit,596explicit_kebab,597bool,598})599}600pub fn load(601&self,602mut store: impl wasmtime::AsContextMut,603instance: &wasmtime::component::Instance,604) -> wasmtime::Result<Guest> {605let _instance = instance;606let _instance_pre = _instance.instance_pre(&store);607let _instance_type = _instance_pre.instance_type();608let mut store = store.as_context_mut();609let _ = &mut store;610let kebab_case = *_instance611.get_typed_func::<(), ()>(&mut store, &self.kebab_case)?612.func();613let foo = *_instance614.get_typed_func::<615(LudicrousSpeed,),616(),617>(&mut store, &self.foo)?618.func();619let function_with_dashes = *_instance620.get_typed_func::<621(),622(),623>(&mut store, &self.function_with_dashes)?624.func();625let function_with_no_weird_characters = *_instance626.get_typed_func::<627(),628(),629>(&mut store, &self.function_with_no_weird_characters)?630.func();631let apple = *_instance632.get_typed_func::<(), ()>(&mut store, &self.apple)?633.func();634let apple_pear = *_instance635.get_typed_func::<(), ()>(&mut store, &self.apple_pear)?636.func();637let apple_pear_grape = *_instance638.get_typed_func::<639(),640(),641>(&mut store, &self.apple_pear_grape)?642.func();643let a0 = *_instance644.get_typed_func::<(), ()>(&mut store, &self.a0)?645.func();646let is_xml = *_instance647.get_typed_func::<(), ()>(&mut store, &self.is_xml)?648.func();649let explicit = *_instance650.get_typed_func::<(), ()>(&mut store, &self.explicit)?651.func();652let explicit_kebab = *_instance653.get_typed_func::<(), ()>(&mut store, &self.explicit_kebab)?654.func();655let bool = *_instance656.get_typed_func::<(), ()>(&mut store, &self.bool)?657.func();658Ok(Guest {659kebab_case,660foo,661function_with_dashes,662function_with_no_weird_characters,663apple,664apple_pear,665apple_pear_grape,666a0,667is_xml,668explicit,669explicit_kebab,670bool,671})672}673}674impl Guest {675pub async fn call_kebab_case<S: wasmtime::AsContextMut>(676&self,677mut store: S,678) -> wasmtime::Result<()>679where680<S as wasmtime::AsContext>::Data: Send,681{682let callee = unsafe {683wasmtime::component::TypedFunc::<684(),685(),686>::new_unchecked(self.kebab_case)687};688let () = callee.call_async(store.as_context_mut(), ()).await?;689Ok(())690}691pub async fn call_foo<S: wasmtime::AsContextMut>(692&self,693mut store: S,694arg0: LudicrousSpeed,695) -> wasmtime::Result<()>696where697<S as wasmtime::AsContext>::Data: Send,698{699let callee = unsafe {700wasmtime::component::TypedFunc::<701(LudicrousSpeed,),702(),703>::new_unchecked(self.foo)704};705let () = callee706.call_async(store.as_context_mut(), (arg0,))707.await?;708Ok(())709}710pub async fn call_function_with_dashes<S: wasmtime::AsContextMut>(711&self,712mut store: S,713) -> wasmtime::Result<()>714where715<S as wasmtime::AsContext>::Data: Send,716{717let callee = unsafe {718wasmtime::component::TypedFunc::<719(),720(),721>::new_unchecked(self.function_with_dashes)722};723let () = callee.call_async(store.as_context_mut(), ()).await?;724Ok(())725}726pub async fn call_function_with_no_weird_characters<727S: wasmtime::AsContextMut,728>(&self, mut store: S) -> wasmtime::Result<()>729where730<S as wasmtime::AsContext>::Data: Send,731{732let callee = unsafe {733wasmtime::component::TypedFunc::<734(),735(),736>::new_unchecked(self.function_with_no_weird_characters)737};738let () = callee.call_async(store.as_context_mut(), ()).await?;739Ok(())740}741pub async fn call_apple<S: wasmtime::AsContextMut>(742&self,743mut store: S,744) -> wasmtime::Result<()>745where746<S as wasmtime::AsContext>::Data: Send,747{748let callee = unsafe {749wasmtime::component::TypedFunc::<750(),751(),752>::new_unchecked(self.apple)753};754let () = callee.call_async(store.as_context_mut(), ()).await?;755Ok(())756}757pub async fn call_apple_pear<S: wasmtime::AsContextMut>(758&self,759mut store: S,760) -> wasmtime::Result<()>761where762<S as wasmtime::AsContext>::Data: Send,763{764let callee = unsafe {765wasmtime::component::TypedFunc::<766(),767(),768>::new_unchecked(self.apple_pear)769};770let () = callee.call_async(store.as_context_mut(), ()).await?;771Ok(())772}773pub async fn call_apple_pear_grape<S: wasmtime::AsContextMut>(774&self,775mut store: S,776) -> wasmtime::Result<()>777where778<S as wasmtime::AsContext>::Data: Send,779{780let callee = unsafe {781wasmtime::component::TypedFunc::<782(),783(),784>::new_unchecked(self.apple_pear_grape)785};786let () = callee.call_async(store.as_context_mut(), ()).await?;787Ok(())788}789pub async fn call_a0<S: wasmtime::AsContextMut>(790&self,791mut store: S,792) -> wasmtime::Result<()>793where794<S as wasmtime::AsContext>::Data: Send,795{796let callee = unsafe {797wasmtime::component::TypedFunc::<798(),799(),800>::new_unchecked(self.a0)801};802let () = callee.call_async(store.as_context_mut(), ()).await?;803Ok(())804}805/// Comment out identifiers that collide when mapped to snake_case, for now; see806/// https://github.com/WebAssembly/component-model/issues/118807/// APPLE: func()808/// APPLE-pear-GRAPE: func()809/// apple-PEAR-grape: func()810pub async fn call_is_xml<S: wasmtime::AsContextMut>(811&self,812mut store: S,813) -> wasmtime::Result<()>814where815<S as wasmtime::AsContext>::Data: Send,816{817let callee = unsafe {818wasmtime::component::TypedFunc::<819(),820(),821>::new_unchecked(self.is_xml)822};823let () = callee.call_async(store.as_context_mut(), ()).await?;824Ok(())825}826pub async fn call_explicit<S: wasmtime::AsContextMut>(827&self,828mut store: S,829) -> wasmtime::Result<()>830where831<S as wasmtime::AsContext>::Data: Send,832{833let callee = unsafe {834wasmtime::component::TypedFunc::<835(),836(),837>::new_unchecked(self.explicit)838};839let () = callee.call_async(store.as_context_mut(), ()).await?;840Ok(())841}842pub async fn call_explicit_kebab<S: wasmtime::AsContextMut>(843&self,844mut store: S,845) -> wasmtime::Result<()>846where847<S as wasmtime::AsContext>::Data: Send,848{849let callee = unsafe {850wasmtime::component::TypedFunc::<851(),852(),853>::new_unchecked(self.explicit_kebab)854};855let () = callee.call_async(store.as_context_mut(), ()).await?;856Ok(())857}858/// Identifiers with the same name as keywords are quoted.859pub async fn call_bool<S: wasmtime::AsContextMut>(860&self,861mut store: S,862) -> wasmtime::Result<()>863where864<S as wasmtime::AsContext>::Data: Send,865{866let callee = unsafe {867wasmtime::component::TypedFunc::<868(),869(),870>::new_unchecked(self.bool)871};872let () = callee.call_async(store.as_context_mut(), ()).await?;873Ok(())874}875}876}877}878}879}880881882