Path: blob/main/crates/component-macro/tests/expanded/conventions_concurrent.rs
3071 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 {226fn kebab_case<T: Send>(227accessor: &wasmtime::component::Accessor<T, Self>,228) -> impl ::core::future::Future<Output = ()> + Send;229fn foo<T: Send>(230accessor: &wasmtime::component::Accessor<T, Self>,231x: LudicrousSpeed,232) -> impl ::core::future::Future<Output = ()> + Send;233fn function_with_dashes<T: Send>(234accessor: &wasmtime::component::Accessor<T, Self>,235) -> impl ::core::future::Future<Output = ()> + Send;236fn function_with_no_weird_characters<T: Send>(237accessor: &wasmtime::component::Accessor<T, Self>,238) -> impl ::core::future::Future<Output = ()> + Send;239fn apple<T: Send>(240accessor: &wasmtime::component::Accessor<T, Self>,241) -> impl ::core::future::Future<Output = ()> + Send;242fn apple_pear<T: Send>(243accessor: &wasmtime::component::Accessor<T, Self>,244) -> impl ::core::future::Future<Output = ()> + Send;245fn apple_pear_grape<T: Send>(246accessor: &wasmtime::component::Accessor<T, Self>,247) -> impl ::core::future::Future<Output = ()> + Send;248fn a0<T: Send>(249accessor: &wasmtime::component::Accessor<T, Self>,250) -> impl ::core::future::Future<Output = ()> + Send;251/// Comment out identifiers that collide when mapped to snake_case, for now; see252/// https://github.com/WebAssembly/component-model/issues/118253/// APPLE: func()254/// APPLE-pear-GRAPE: func()255/// apple-PEAR-grape: func()256fn is_xml<T: Send>(257accessor: &wasmtime::component::Accessor<T, Self>,258) -> impl ::core::future::Future<Output = ()> + Send;259fn explicit<T: Send>(260accessor: &wasmtime::component::Accessor<T, Self>,261) -> impl ::core::future::Future<Output = ()> + Send;262fn explicit_kebab<T: Send>(263accessor: &wasmtime::component::Accessor<T, Self>,264) -> impl ::core::future::Future<Output = ()> + Send;265/// Identifiers with the same name as keywords are quoted.266fn bool<T: Send>(267accessor: &wasmtime::component::Accessor<T, Self>,268) -> impl ::core::future::Future<Output = ()> + Send;269}270pub trait Host: Send {}271impl<_T: Host + ?Sized + Send> Host for &mut _T {}272pub fn add_to_linker<T, D>(273linker: &mut wasmtime::component::Linker<T>,274host_getter: fn(&mut T) -> D::Data<'_>,275) -> wasmtime::Result<()>276where277D: HostWithStore,278for<'a> D::Data<'a>: Host,279T: 'static + Send,280{281let mut inst = linker.instance("foo:foo/conventions")?;282inst.func_wrap_concurrent(283"kebab-case",284move |caller: &wasmtime::component::Accessor<T>, (): ()| {285wasmtime::component::__internal::Box::pin(async move {286let host = &caller.with_getter(host_getter);287let r = <D as HostWithStore>::kebab_case(host).await;288Ok(r)289})290},291)?;292inst.func_wrap_concurrent(293"foo",294move |295caller: &wasmtime::component::Accessor<T>,296(arg0,): (LudicrousSpeed,)|297{298wasmtime::component::__internal::Box::pin(async move {299let host = &caller.with_getter(host_getter);300let r = <D as HostWithStore>::foo(host, arg0).await;301Ok(r)302})303},304)?;305inst.func_wrap_concurrent(306"function-with-dashes",307move |caller: &wasmtime::component::Accessor<T>, (): ()| {308wasmtime::component::__internal::Box::pin(async move {309let host = &caller.with_getter(host_getter);310let r = <D as HostWithStore>::function_with_dashes(host)311.await;312Ok(r)313})314},315)?;316inst.func_wrap_concurrent(317"function-with-no-weird-characters",318move |caller: &wasmtime::component::Accessor<T>, (): ()| {319wasmtime::component::__internal::Box::pin(async move {320let host = &caller.with_getter(host_getter);321let r = <D as HostWithStore>::function_with_no_weird_characters(322host,323)324.await;325Ok(r)326})327},328)?;329inst.func_wrap_concurrent(330"apple",331move |caller: &wasmtime::component::Accessor<T>, (): ()| {332wasmtime::component::__internal::Box::pin(async move {333let host = &caller.with_getter(host_getter);334let r = <D as HostWithStore>::apple(host).await;335Ok(r)336})337},338)?;339inst.func_wrap_concurrent(340"apple-pear",341move |caller: &wasmtime::component::Accessor<T>, (): ()| {342wasmtime::component::__internal::Box::pin(async move {343let host = &caller.with_getter(host_getter);344let r = <D as HostWithStore>::apple_pear(host).await;345Ok(r)346})347},348)?;349inst.func_wrap_concurrent(350"apple-pear-grape",351move |caller: &wasmtime::component::Accessor<T>, (): ()| {352wasmtime::component::__internal::Box::pin(async move {353let host = &caller.with_getter(host_getter);354let r = <D as HostWithStore>::apple_pear_grape(host).await;355Ok(r)356})357},358)?;359inst.func_wrap_concurrent(360"a0",361move |caller: &wasmtime::component::Accessor<T>, (): ()| {362wasmtime::component::__internal::Box::pin(async move {363let host = &caller.with_getter(host_getter);364let r = <D as HostWithStore>::a0(host).await;365Ok(r)366})367},368)?;369inst.func_wrap_concurrent(370"is-XML",371move |caller: &wasmtime::component::Accessor<T>, (): ()| {372wasmtime::component::__internal::Box::pin(async move {373let host = &caller.with_getter(host_getter);374let r = <D as HostWithStore>::is_xml(host).await;375Ok(r)376})377},378)?;379inst.func_wrap_concurrent(380"explicit",381move |caller: &wasmtime::component::Accessor<T>, (): ()| {382wasmtime::component::__internal::Box::pin(async move {383let host = &caller.with_getter(host_getter);384let r = <D as HostWithStore>::explicit(host).await;385Ok(r)386})387},388)?;389inst.func_wrap_concurrent(390"explicit-kebab",391move |caller: &wasmtime::component::Accessor<T>, (): ()| {392wasmtime::component::__internal::Box::pin(async move {393let host = &caller.with_getter(host_getter);394let r = <D as HostWithStore>::explicit_kebab(host).await;395Ok(r)396})397},398)?;399inst.func_wrap_concurrent(400"bool",401move |caller: &wasmtime::component::Accessor<T>, (): ()| {402wasmtime::component::__internal::Box::pin(async move {403let host = &caller.with_getter(host_getter);404let r = <D as HostWithStore>::bool(host).await;405Ok(r)406})407},408)?;409Ok(())410}411}412}413}414pub mod exports {415pub mod foo {416pub mod foo {417#[allow(clippy::all)]418pub mod conventions {419#[allow(unused_imports)]420use wasmtime::component::__internal::Box;421#[derive(wasmtime::component::ComponentType)]422#[derive(wasmtime::component::Lift)]423#[derive(wasmtime::component::Lower)]424#[component(record)]425#[derive(Clone, Copy)]426pub struct LudicrousSpeed {427#[component(name = "how-fast-are-you-going")]428pub how_fast_are_you_going: u32,429#[component(name = "i-am-going-extremely-slow")]430pub i_am_going_extremely_slow: u64,431}432impl core::fmt::Debug for LudicrousSpeed {433fn fmt(434&self,435f: &mut core::fmt::Formatter<'_>,436) -> core::fmt::Result {437f.debug_struct("LudicrousSpeed")438.field(439"how-fast-are-you-going",440&self.how_fast_are_you_going,441)442.field(443"i-am-going-extremely-slow",444&self.i_am_going_extremely_slow,445)446.finish()447}448}449const _: () = {450assert!(45116 == < LudicrousSpeed as wasmtime::component::ComponentType452>::SIZE32453);454assert!(4558 == < LudicrousSpeed as wasmtime::component::ComponentType456>::ALIGN32457);458};459#[derive(Clone)]460pub struct Guest {461kebab_case: wasmtime::component::Func,462foo: wasmtime::component::Func,463function_with_dashes: wasmtime::component::Func,464function_with_no_weird_characters: wasmtime::component::Func,465apple: wasmtime::component::Func,466apple_pear: wasmtime::component::Func,467apple_pear_grape: wasmtime::component::Func,468a0: wasmtime::component::Func,469is_xml: wasmtime::component::Func,470explicit: wasmtime::component::Func,471explicit_kebab: wasmtime::component::Func,472bool: wasmtime::component::Func,473}474#[derive(Clone)]475pub struct GuestIndices {476kebab_case: wasmtime::component::ComponentExportIndex,477foo: wasmtime::component::ComponentExportIndex,478function_with_dashes: wasmtime::component::ComponentExportIndex,479function_with_no_weird_characters: wasmtime::component::ComponentExportIndex,480apple: wasmtime::component::ComponentExportIndex,481apple_pear: wasmtime::component::ComponentExportIndex,482apple_pear_grape: wasmtime::component::ComponentExportIndex,483a0: wasmtime::component::ComponentExportIndex,484is_xml: wasmtime::component::ComponentExportIndex,485explicit: wasmtime::component::ComponentExportIndex,486explicit_kebab: wasmtime::component::ComponentExportIndex,487bool: wasmtime::component::ComponentExportIndex,488}489impl GuestIndices {490/// Constructor for [`GuestIndices`] which takes a491/// [`Component`](wasmtime::component::Component) as input and can be executed492/// before instantiation.493///494/// This constructor can be used to front-load string lookups to find exports495/// within a component.496pub fn new<_T>(497_instance_pre: &wasmtime::component::InstancePre<_T>,498) -> wasmtime::Result<GuestIndices> {499let instance = _instance_pre500.component()501.get_export_index(None, "foo:foo/conventions")502.ok_or_else(|| {503wasmtime::format_err!(504"no exported instance named `foo:foo/conventions`"505)506})?;507let mut lookup = move |name| {508_instance_pre509.component()510.get_export_index(Some(&instance), name)511.ok_or_else(|| {512wasmtime::format_err!(513"instance export `foo:foo/conventions` does \514not have export `{name}`"515)516})517};518let _ = &mut lookup;519let kebab_case = lookup("kebab-case")?;520let foo = lookup("foo")?;521let function_with_dashes = lookup("function-with-dashes")?;522let function_with_no_weird_characters = lookup(523"function-with-no-weird-characters",524)?;525let apple = lookup("apple")?;526let apple_pear = lookup("apple-pear")?;527let apple_pear_grape = lookup("apple-pear-grape")?;528let a0 = lookup("a0")?;529let is_xml = lookup("is-XML")?;530let explicit = lookup("explicit")?;531let explicit_kebab = lookup("explicit-kebab")?;532let bool = lookup("bool")?;533Ok(GuestIndices {534kebab_case,535foo,536function_with_dashes,537function_with_no_weird_characters,538apple,539apple_pear,540apple_pear_grape,541a0,542is_xml,543explicit,544explicit_kebab,545bool,546})547}548pub fn load(549&self,550mut store: impl wasmtime::AsContextMut,551instance: &wasmtime::component::Instance,552) -> wasmtime::Result<Guest> {553let _instance = instance;554let _instance_pre = _instance.instance_pre(&store);555let _instance_type = _instance_pre.instance_type();556let mut store = store.as_context_mut();557let _ = &mut store;558let kebab_case = *_instance559.get_typed_func::<(), ()>(&mut store, &self.kebab_case)?560.func();561let foo = *_instance562.get_typed_func::<563(LudicrousSpeed,),564(),565>(&mut store, &self.foo)?566.func();567let function_with_dashes = *_instance568.get_typed_func::<569(),570(),571>(&mut store, &self.function_with_dashes)?572.func();573let function_with_no_weird_characters = *_instance574.get_typed_func::<575(),576(),577>(&mut store, &self.function_with_no_weird_characters)?578.func();579let apple = *_instance580.get_typed_func::<(), ()>(&mut store, &self.apple)?581.func();582let apple_pear = *_instance583.get_typed_func::<(), ()>(&mut store, &self.apple_pear)?584.func();585let apple_pear_grape = *_instance586.get_typed_func::<587(),588(),589>(&mut store, &self.apple_pear_grape)?590.func();591let a0 = *_instance592.get_typed_func::<(), ()>(&mut store, &self.a0)?593.func();594let is_xml = *_instance595.get_typed_func::<(), ()>(&mut store, &self.is_xml)?596.func();597let explicit = *_instance598.get_typed_func::<(), ()>(&mut store, &self.explicit)?599.func();600let explicit_kebab = *_instance601.get_typed_func::<(), ()>(&mut store, &self.explicit_kebab)?602.func();603let bool = *_instance604.get_typed_func::<(), ()>(&mut store, &self.bool)?605.func();606Ok(Guest {607kebab_case,608foo,609function_with_dashes,610function_with_no_weird_characters,611apple,612apple_pear,613apple_pear_grape,614a0,615is_xml,616explicit,617explicit_kebab,618bool,619})620}621}622impl Guest {623pub async fn call_kebab_case<_T, _D>(624&self,625accessor: &wasmtime::component::Accessor<_T, _D>,626) -> wasmtime::Result<()>627where628_T: Send,629_D: wasmtime::component::HasData,630{631let callee = unsafe {632wasmtime::component::TypedFunc::<633(),634(),635>::new_unchecked(self.kebab_case)636};637let ((), _) = callee.call_concurrent(accessor, ()).await?;638Ok(())639}640pub async fn call_foo<_T, _D>(641&self,642accessor: &wasmtime::component::Accessor<_T, _D>,643arg0: LudicrousSpeed,644) -> wasmtime::Result<()>645where646_T: Send,647_D: wasmtime::component::HasData,648{649let callee = unsafe {650wasmtime::component::TypedFunc::<651(LudicrousSpeed,),652(),653>::new_unchecked(self.foo)654};655let ((), _) = callee.call_concurrent(accessor, (arg0,)).await?;656Ok(())657}658pub async fn call_function_with_dashes<_T, _D>(659&self,660accessor: &wasmtime::component::Accessor<_T, _D>,661) -> wasmtime::Result<()>662where663_T: Send,664_D: wasmtime::component::HasData,665{666let callee = unsafe {667wasmtime::component::TypedFunc::<668(),669(),670>::new_unchecked(self.function_with_dashes)671};672let ((), _) = callee.call_concurrent(accessor, ()).await?;673Ok(())674}675pub async fn call_function_with_no_weird_characters<_T, _D>(676&self,677accessor: &wasmtime::component::Accessor<_T, _D>,678) -> wasmtime::Result<()>679where680_T: Send,681_D: wasmtime::component::HasData,682{683let callee = unsafe {684wasmtime::component::TypedFunc::<685(),686(),687>::new_unchecked(self.function_with_no_weird_characters)688};689let ((), _) = callee.call_concurrent(accessor, ()).await?;690Ok(())691}692pub async fn call_apple<_T, _D>(693&self,694accessor: &wasmtime::component::Accessor<_T, _D>,695) -> wasmtime::Result<()>696where697_T: Send,698_D: wasmtime::component::HasData,699{700let callee = unsafe {701wasmtime::component::TypedFunc::<702(),703(),704>::new_unchecked(self.apple)705};706let ((), _) = callee.call_concurrent(accessor, ()).await?;707Ok(())708}709pub async fn call_apple_pear<_T, _D>(710&self,711accessor: &wasmtime::component::Accessor<_T, _D>,712) -> wasmtime::Result<()>713where714_T: Send,715_D: wasmtime::component::HasData,716{717let callee = unsafe {718wasmtime::component::TypedFunc::<719(),720(),721>::new_unchecked(self.apple_pear)722};723let ((), _) = callee.call_concurrent(accessor, ()).await?;724Ok(())725}726pub async fn call_apple_pear_grape<_T, _D>(727&self,728accessor: &wasmtime::component::Accessor<_T, _D>,729) -> wasmtime::Result<()>730where731_T: Send,732_D: wasmtime::component::HasData,733{734let callee = unsafe {735wasmtime::component::TypedFunc::<736(),737(),738>::new_unchecked(self.apple_pear_grape)739};740let ((), _) = callee.call_concurrent(accessor, ()).await?;741Ok(())742}743pub async fn call_a0<_T, _D>(744&self,745accessor: &wasmtime::component::Accessor<_T, _D>,746) -> wasmtime::Result<()>747where748_T: Send,749_D: wasmtime::component::HasData,750{751let callee = unsafe {752wasmtime::component::TypedFunc::<753(),754(),755>::new_unchecked(self.a0)756};757let ((), _) = callee.call_concurrent(accessor, ()).await?;758Ok(())759}760/// Comment out identifiers that collide when mapped to snake_case, for now; see761/// https://github.com/WebAssembly/component-model/issues/118762/// APPLE: func()763/// APPLE-pear-GRAPE: func()764/// apple-PEAR-grape: func()765pub async fn call_is_xml<_T, _D>(766&self,767accessor: &wasmtime::component::Accessor<_T, _D>,768) -> wasmtime::Result<()>769where770_T: Send,771_D: wasmtime::component::HasData,772{773let callee = unsafe {774wasmtime::component::TypedFunc::<775(),776(),777>::new_unchecked(self.is_xml)778};779let ((), _) = callee.call_concurrent(accessor, ()).await?;780Ok(())781}782pub async fn call_explicit<_T, _D>(783&self,784accessor: &wasmtime::component::Accessor<_T, _D>,785) -> wasmtime::Result<()>786where787_T: Send,788_D: wasmtime::component::HasData,789{790let callee = unsafe {791wasmtime::component::TypedFunc::<792(),793(),794>::new_unchecked(self.explicit)795};796let ((), _) = callee.call_concurrent(accessor, ()).await?;797Ok(())798}799pub async fn call_explicit_kebab<_T, _D>(800&self,801accessor: &wasmtime::component::Accessor<_T, _D>,802) -> wasmtime::Result<()>803where804_T: Send,805_D: wasmtime::component::HasData,806{807let callee = unsafe {808wasmtime::component::TypedFunc::<809(),810(),811>::new_unchecked(self.explicit_kebab)812};813let ((), _) = callee.call_concurrent(accessor, ()).await?;814Ok(())815}816/// Identifiers with the same name as keywords are quoted.817pub async fn call_bool<_T, _D>(818&self,819accessor: &wasmtime::component::Accessor<_T, _D>,820) -> wasmtime::Result<()>821where822_T: Send,823_D: wasmtime::component::HasData,824{825let callee = unsafe {826wasmtime::component::TypedFunc::<827(),828(),829>::new_unchecked(self.bool)830};831let ((), _) = callee.call_concurrent(accessor, ()).await?;832Ok(())833}834}835}836}837}838}839840841