Path: blob/main/crates/component-macro/tests/expanded/conventions_concurrent.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::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 _: () = {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::conventions::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::conventions::HostWithStore + Send,178for<'a> D::Data<'a>: foo::foo::conventions::Host + Send,179T: 'static + Send,180{181foo::foo::conventions::add_to_linker::<T, D>(linker, host_getter)?;182Ok(())183}184pub fn foo_foo_conventions(&self) -> &exports::foo::foo::conventions::Guest {185&self.interface0186}187}188};189pub mod foo {190pub mod foo {191#[allow(clippy::all)]192pub mod conventions {193#[allow(unused_imports)]194use wasmtime::component::__internal::{anyhow, Box};195#[derive(wasmtime::component::ComponentType)]196#[derive(wasmtime::component::Lift)]197#[derive(wasmtime::component::Lower)]198#[component(record)]199#[derive(Clone, Copy)]200pub struct LudicrousSpeed {201#[component(name = "how-fast-are-you-going")]202pub how_fast_are_you_going: u32,203#[component(name = "i-am-going-extremely-slow")]204pub i_am_going_extremely_slow: u64,205}206impl core::fmt::Debug for LudicrousSpeed {207fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {208f.debug_struct("LudicrousSpeed")209.field("how-fast-are-you-going", &self.how_fast_are_you_going)210.field(211"i-am-going-extremely-slow",212&self.i_am_going_extremely_slow,213)214.finish()215}216}217const _: () = {218assert!(21916 == < LudicrousSpeed as wasmtime::component::ComponentType220>::SIZE32221);222assert!(2238 == < LudicrousSpeed as wasmtime::component::ComponentType224>::ALIGN32225);226};227pub trait HostWithStore: wasmtime::component::HasData + Send {228fn kebab_case<T>(229accessor: &wasmtime::component::Accessor<T, Self>,230) -> impl ::core::future::Future<Output = ()> + Send;231fn foo<T>(232accessor: &wasmtime::component::Accessor<T, Self>,233x: LudicrousSpeed,234) -> impl ::core::future::Future<Output = ()> + Send;235fn function_with_dashes<T>(236accessor: &wasmtime::component::Accessor<T, Self>,237) -> impl ::core::future::Future<Output = ()> + Send;238fn function_with_no_weird_characters<T>(239accessor: &wasmtime::component::Accessor<T, Self>,240) -> impl ::core::future::Future<Output = ()> + Send;241fn apple<T>(242accessor: &wasmtime::component::Accessor<T, Self>,243) -> impl ::core::future::Future<Output = ()> + Send;244fn apple_pear<T>(245accessor: &wasmtime::component::Accessor<T, Self>,246) -> impl ::core::future::Future<Output = ()> + Send;247fn apple_pear_grape<T>(248accessor: &wasmtime::component::Accessor<T, Self>,249) -> impl ::core::future::Future<Output = ()> + Send;250fn a0<T>(251accessor: &wasmtime::component::Accessor<T, Self>,252) -> impl ::core::future::Future<Output = ()> + Send;253/// Comment out identifiers that collide when mapped to snake_case, for now; see254/// https://github.com/WebAssembly/component-model/issues/118255/// APPLE: func()256/// APPLE-pear-GRAPE: func()257/// apple-PEAR-grape: func()258fn is_xml<T>(259accessor: &wasmtime::component::Accessor<T, Self>,260) -> impl ::core::future::Future<Output = ()> + Send;261fn explicit<T>(262accessor: &wasmtime::component::Accessor<T, Self>,263) -> impl ::core::future::Future<Output = ()> + Send;264fn explicit_kebab<T>(265accessor: &wasmtime::component::Accessor<T, Self>,266) -> impl ::core::future::Future<Output = ()> + Send;267/// Identifiers with the same name as keywords are quoted.268fn bool<T>(269accessor: &wasmtime::component::Accessor<T, Self>,270) -> impl ::core::future::Future<Output = ()> + Send;271}272pub trait Host: Send {}273impl<_T: Host + ?Sized + Send> Host for &mut _T {}274pub fn add_to_linker<T, D>(275linker: &mut wasmtime::component::Linker<T>,276host_getter: fn(&mut T) -> D::Data<'_>,277) -> wasmtime::Result<()>278where279D: HostWithStore,280for<'a> D::Data<'a>: Host,281T: 'static + Send,282{283let mut inst = linker.instance("foo:foo/conventions")?;284inst.func_wrap_concurrent(285"kebab-case",286move |caller: &wasmtime::component::Accessor<T>, (): ()| {287wasmtime::component::__internal::Box::pin(async move {288let host = &caller.with_getter(host_getter);289let r = <D as HostWithStore>::kebab_case(host).await;290Ok(r)291})292},293)?;294inst.func_wrap_concurrent(295"foo",296move |297caller: &wasmtime::component::Accessor<T>,298(arg0,): (LudicrousSpeed,)|299{300wasmtime::component::__internal::Box::pin(async move {301let host = &caller.with_getter(host_getter);302let r = <D as HostWithStore>::foo(host, arg0).await;303Ok(r)304})305},306)?;307inst.func_wrap_concurrent(308"function-with-dashes",309move |caller: &wasmtime::component::Accessor<T>, (): ()| {310wasmtime::component::__internal::Box::pin(async move {311let host = &caller.with_getter(host_getter);312let r = <D as HostWithStore>::function_with_dashes(host)313.await;314Ok(r)315})316},317)?;318inst.func_wrap_concurrent(319"function-with-no-weird-characters",320move |caller: &wasmtime::component::Accessor<T>, (): ()| {321wasmtime::component::__internal::Box::pin(async move {322let host = &caller.with_getter(host_getter);323let r = <D as HostWithStore>::function_with_no_weird_characters(324host,325)326.await;327Ok(r)328})329},330)?;331inst.func_wrap_concurrent(332"apple",333move |caller: &wasmtime::component::Accessor<T>, (): ()| {334wasmtime::component::__internal::Box::pin(async move {335let host = &caller.with_getter(host_getter);336let r = <D as HostWithStore>::apple(host).await;337Ok(r)338})339},340)?;341inst.func_wrap_concurrent(342"apple-pear",343move |caller: &wasmtime::component::Accessor<T>, (): ()| {344wasmtime::component::__internal::Box::pin(async move {345let host = &caller.with_getter(host_getter);346let r = <D as HostWithStore>::apple_pear(host).await;347Ok(r)348})349},350)?;351inst.func_wrap_concurrent(352"apple-pear-grape",353move |caller: &wasmtime::component::Accessor<T>, (): ()| {354wasmtime::component::__internal::Box::pin(async move {355let host = &caller.with_getter(host_getter);356let r = <D as HostWithStore>::apple_pear_grape(host).await;357Ok(r)358})359},360)?;361inst.func_wrap_concurrent(362"a0",363move |caller: &wasmtime::component::Accessor<T>, (): ()| {364wasmtime::component::__internal::Box::pin(async move {365let host = &caller.with_getter(host_getter);366let r = <D as HostWithStore>::a0(host).await;367Ok(r)368})369},370)?;371inst.func_wrap_concurrent(372"is-XML",373move |caller: &wasmtime::component::Accessor<T>, (): ()| {374wasmtime::component::__internal::Box::pin(async move {375let host = &caller.with_getter(host_getter);376let r = <D as HostWithStore>::is_xml(host).await;377Ok(r)378})379},380)?;381inst.func_wrap_concurrent(382"explicit",383move |caller: &wasmtime::component::Accessor<T>, (): ()| {384wasmtime::component::__internal::Box::pin(async move {385let host = &caller.with_getter(host_getter);386let r = <D as HostWithStore>::explicit(host).await;387Ok(r)388})389},390)?;391inst.func_wrap_concurrent(392"explicit-kebab",393move |caller: &wasmtime::component::Accessor<T>, (): ()| {394wasmtime::component::__internal::Box::pin(async move {395let host = &caller.with_getter(host_getter);396let r = <D as HostWithStore>::explicit_kebab(host).await;397Ok(r)398})399},400)?;401inst.func_wrap_concurrent(402"bool",403move |caller: &wasmtime::component::Accessor<T>, (): ()| {404wasmtime::component::__internal::Box::pin(async move {405let host = &caller.with_getter(host_getter);406let r = <D as HostWithStore>::bool(host).await;407Ok(r)408})409},410)?;411Ok(())412}413}414}415}416pub mod exports {417pub mod foo {418pub mod foo {419#[allow(clippy::all)]420pub mod conventions {421#[allow(unused_imports)]422use wasmtime::component::__internal::{anyhow, Box};423#[derive(wasmtime::component::ComponentType)]424#[derive(wasmtime::component::Lift)]425#[derive(wasmtime::component::Lower)]426#[component(record)]427#[derive(Clone, Copy)]428pub struct LudicrousSpeed {429#[component(name = "how-fast-are-you-going")]430pub how_fast_are_you_going: u32,431#[component(name = "i-am-going-extremely-slow")]432pub i_am_going_extremely_slow: u64,433}434impl core::fmt::Debug for LudicrousSpeed {435fn fmt(436&self,437f: &mut core::fmt::Formatter<'_>,438) -> core::fmt::Result {439f.debug_struct("LudicrousSpeed")440.field(441"how-fast-are-you-going",442&self.how_fast_are_you_going,443)444.field(445"i-am-going-extremely-slow",446&self.i_am_going_extremely_slow,447)448.finish()449}450}451const _: () = {452assert!(45316 == < LudicrousSpeed as wasmtime::component::ComponentType454>::SIZE32455);456assert!(4578 == < LudicrousSpeed as wasmtime::component::ComponentType458>::ALIGN32459);460};461pub struct Guest {462kebab_case: wasmtime::component::Func,463foo: wasmtime::component::Func,464function_with_dashes: wasmtime::component::Func,465function_with_no_weird_characters: wasmtime::component::Func,466apple: wasmtime::component::Func,467apple_pear: wasmtime::component::Func,468apple_pear_grape: wasmtime::component::Func,469a0: wasmtime::component::Func,470is_xml: wasmtime::component::Func,471explicit: wasmtime::component::Func,472explicit_kebab: wasmtime::component::Func,473bool: wasmtime::component::Func,474}475#[derive(Clone)]476pub struct GuestIndices {477kebab_case: wasmtime::component::ComponentExportIndex,478foo: wasmtime::component::ComponentExportIndex,479function_with_dashes: wasmtime::component::ComponentExportIndex,480function_with_no_weird_characters: wasmtime::component::ComponentExportIndex,481apple: wasmtime::component::ComponentExportIndex,482apple_pear: wasmtime::component::ComponentExportIndex,483apple_pear_grape: wasmtime::component::ComponentExportIndex,484a0: wasmtime::component::ComponentExportIndex,485is_xml: wasmtime::component::ComponentExportIndex,486explicit: wasmtime::component::ComponentExportIndex,487explicit_kebab: wasmtime::component::ComponentExportIndex,488bool: wasmtime::component::ComponentExportIndex,489}490impl GuestIndices {491/// Constructor for [`GuestIndices`] which takes a492/// [`Component`](wasmtime::component::Component) as input and can be executed493/// before instantiation.494///495/// This constructor can be used to front-load string lookups to find exports496/// within a component.497pub fn new<_T>(498_instance_pre: &wasmtime::component::InstancePre<_T>,499) -> wasmtime::Result<GuestIndices> {500let instance = _instance_pre501.component()502.get_export_index(None, "foo:foo/conventions")503.ok_or_else(|| {504anyhow::anyhow!(505"no exported instance named `foo:foo/conventions`"506)507})?;508let mut lookup = move |name| {509_instance_pre510.component()511.get_export_index(Some(&instance), name)512.ok_or_else(|| {513anyhow::anyhow!(514"instance export `foo:foo/conventions` does \515not have export `{name}`"516)517})518};519let _ = &mut lookup;520let kebab_case = lookup("kebab-case")?;521let foo = lookup("foo")?;522let function_with_dashes = lookup("function-with-dashes")?;523let function_with_no_weird_characters = lookup(524"function-with-no-weird-characters",525)?;526let apple = lookup("apple")?;527let apple_pear = lookup("apple-pear")?;528let apple_pear_grape = lookup("apple-pear-grape")?;529let a0 = lookup("a0")?;530let is_xml = lookup("is-XML")?;531let explicit = lookup("explicit")?;532let explicit_kebab = lookup("explicit-kebab")?;533let bool = lookup("bool")?;534Ok(GuestIndices {535kebab_case,536foo,537function_with_dashes,538function_with_no_weird_characters,539apple,540apple_pear,541apple_pear_grape,542a0,543is_xml,544explicit,545explicit_kebab,546bool,547})548}549pub fn load(550&self,551mut store: impl wasmtime::AsContextMut,552instance: &wasmtime::component::Instance,553) -> wasmtime::Result<Guest> {554let _instance = instance;555let _instance_pre = _instance.instance_pre(&store);556let _instance_type = _instance_pre.instance_type();557let mut store = store.as_context_mut();558let _ = &mut store;559let kebab_case = *_instance560.get_typed_func::<(), ()>(&mut store, &self.kebab_case)?561.func();562let foo = *_instance563.get_typed_func::<564(LudicrousSpeed,),565(),566>(&mut store, &self.foo)?567.func();568let function_with_dashes = *_instance569.get_typed_func::<570(),571(),572>(&mut store, &self.function_with_dashes)?573.func();574let function_with_no_weird_characters = *_instance575.get_typed_func::<576(),577(),578>(&mut store, &self.function_with_no_weird_characters)?579.func();580let apple = *_instance581.get_typed_func::<(), ()>(&mut store, &self.apple)?582.func();583let apple_pear = *_instance584.get_typed_func::<(), ()>(&mut store, &self.apple_pear)?585.func();586let apple_pear_grape = *_instance587.get_typed_func::<588(),589(),590>(&mut store, &self.apple_pear_grape)?591.func();592let a0 = *_instance593.get_typed_func::<(), ()>(&mut store, &self.a0)?594.func();595let is_xml = *_instance596.get_typed_func::<(), ()>(&mut store, &self.is_xml)?597.func();598let explicit = *_instance599.get_typed_func::<(), ()>(&mut store, &self.explicit)?600.func();601let explicit_kebab = *_instance602.get_typed_func::<(), ()>(&mut store, &self.explicit_kebab)?603.func();604let bool = *_instance605.get_typed_func::<(), ()>(&mut store, &self.bool)?606.func();607Ok(Guest {608kebab_case,609foo,610function_with_dashes,611function_with_no_weird_characters,612apple,613apple_pear,614apple_pear_grape,615a0,616is_xml,617explicit,618explicit_kebab,619bool,620})621}622}623impl Guest {624pub async fn call_kebab_case<_T, _D>(625&self,626accessor: &wasmtime::component::Accessor<_T, _D>,627) -> wasmtime::Result<()>628where629_T: Send,630_D: wasmtime::component::HasData,631{632let callee = unsafe {633wasmtime::component::TypedFunc::<634(),635(),636>::new_unchecked(self.kebab_case)637};638let () = callee.call_concurrent(accessor, ()).await?;639Ok(())640}641pub async fn call_foo<_T, _D>(642&self,643accessor: &wasmtime::component::Accessor<_T, _D>,644arg0: LudicrousSpeed,645) -> wasmtime::Result<()>646where647_T: Send,648_D: wasmtime::component::HasData,649{650let callee = unsafe {651wasmtime::component::TypedFunc::<652(LudicrousSpeed,),653(),654>::new_unchecked(self.foo)655};656let () = callee.call_concurrent(accessor, (arg0,)).await?;657Ok(())658}659pub async fn call_function_with_dashes<_T, _D>(660&self,661accessor: &wasmtime::component::Accessor<_T, _D>,662) -> wasmtime::Result<()>663where664_T: Send,665_D: wasmtime::component::HasData,666{667let callee = unsafe {668wasmtime::component::TypedFunc::<669(),670(),671>::new_unchecked(self.function_with_dashes)672};673let () = callee.call_concurrent(accessor, ()).await?;674Ok(())675}676pub async fn call_function_with_no_weird_characters<_T, _D>(677&self,678accessor: &wasmtime::component::Accessor<_T, _D>,679) -> wasmtime::Result<()>680where681_T: Send,682_D: wasmtime::component::HasData,683{684let callee = unsafe {685wasmtime::component::TypedFunc::<686(),687(),688>::new_unchecked(self.function_with_no_weird_characters)689};690let () = callee.call_concurrent(accessor, ()).await?;691Ok(())692}693pub async fn call_apple<_T, _D>(694&self,695accessor: &wasmtime::component::Accessor<_T, _D>,696) -> wasmtime::Result<()>697where698_T: Send,699_D: wasmtime::component::HasData,700{701let callee = unsafe {702wasmtime::component::TypedFunc::<703(),704(),705>::new_unchecked(self.apple)706};707let () = callee.call_concurrent(accessor, ()).await?;708Ok(())709}710pub async fn call_apple_pear<_T, _D>(711&self,712accessor: &wasmtime::component::Accessor<_T, _D>,713) -> wasmtime::Result<()>714where715_T: Send,716_D: wasmtime::component::HasData,717{718let callee = unsafe {719wasmtime::component::TypedFunc::<720(),721(),722>::new_unchecked(self.apple_pear)723};724let () = callee.call_concurrent(accessor, ()).await?;725Ok(())726}727pub async fn call_apple_pear_grape<_T, _D>(728&self,729accessor: &wasmtime::component::Accessor<_T, _D>,730) -> wasmtime::Result<()>731where732_T: Send,733_D: wasmtime::component::HasData,734{735let callee = unsafe {736wasmtime::component::TypedFunc::<737(),738(),739>::new_unchecked(self.apple_pear_grape)740};741let () = callee.call_concurrent(accessor, ()).await?;742Ok(())743}744pub async fn call_a0<_T, _D>(745&self,746accessor: &wasmtime::component::Accessor<_T, _D>,747) -> wasmtime::Result<()>748where749_T: Send,750_D: wasmtime::component::HasData,751{752let callee = unsafe {753wasmtime::component::TypedFunc::<754(),755(),756>::new_unchecked(self.a0)757};758let () = callee.call_concurrent(accessor, ()).await?;759Ok(())760}761/// Comment out identifiers that collide when mapped to snake_case, for now; see762/// https://github.com/WebAssembly/component-model/issues/118763/// APPLE: func()764/// APPLE-pear-GRAPE: func()765/// apple-PEAR-grape: func()766pub async fn call_is_xml<_T, _D>(767&self,768accessor: &wasmtime::component::Accessor<_T, _D>,769) -> wasmtime::Result<()>770where771_T: Send,772_D: wasmtime::component::HasData,773{774let callee = unsafe {775wasmtime::component::TypedFunc::<776(),777(),778>::new_unchecked(self.is_xml)779};780let () = callee.call_concurrent(accessor, ()).await?;781Ok(())782}783pub async fn call_explicit<_T, _D>(784&self,785accessor: &wasmtime::component::Accessor<_T, _D>,786) -> wasmtime::Result<()>787where788_T: Send,789_D: wasmtime::component::HasData,790{791let callee = unsafe {792wasmtime::component::TypedFunc::<793(),794(),795>::new_unchecked(self.explicit)796};797let () = callee.call_concurrent(accessor, ()).await?;798Ok(())799}800pub async fn call_explicit_kebab<_T, _D>(801&self,802accessor: &wasmtime::component::Accessor<_T, _D>,803) -> wasmtime::Result<()>804where805_T: Send,806_D: wasmtime::component::HasData,807{808let callee = unsafe {809wasmtime::component::TypedFunc::<810(),811(),812>::new_unchecked(self.explicit_kebab)813};814let () = callee.call_concurrent(accessor, ()).await?;815Ok(())816}817/// Identifiers with the same name as keywords are quoted.818pub async fn call_bool<_T, _D>(819&self,820accessor: &wasmtime::component::Accessor<_T, _D>,821) -> wasmtime::Result<()>822where823_T: Send,824_D: wasmtime::component::HasData,825{826let callee = unsafe {827wasmtime::component::TypedFunc::<828(),829(),830>::new_unchecked(self.bool)831};832let () = callee.call_concurrent(accessor, ()).await?;833Ok(())834}835}836}837}838}839}840841842