Path: blob/main/crates/misc/component-async-tests/src/round_trip_many.rs
1692 views
use super::Ctx;1use anyhow::Result;2use std::time::Duration;3use wasmtime::component::Accessor;45pub mod bindings {6wasmtime::component::bindgen!({7path: "wit",8world: "round-trip-many",9additional_derives: [ Eq, PartialEq ],10});11}1213pub mod non_concurrent_export_bindings {14wasmtime::component::bindgen!({15path: "wit",16world: "round-trip-many",17additional_derives: [ Eq, PartialEq ],18exports: { default: ignore_wit | async },19});20}2122use bindings::local::local::many::Stuff;2324impl bindings::local::local::many::HostWithStore for Ctx {25async fn foo<T>(26_: &Accessor<T, Self>,27a: String,28b: u32,29c: Vec<u8>,30d: (u64, u64),31e: Stuff,32f: Option<Stuff>,33g: Result<Stuff, ()>,34) -> (35String,36u32,37Vec<u8>,38(u64, u64),39Stuff,40Option<Stuff>,41Result<Stuff, ()>,42) {43crate::util::sleep(Duration::from_millis(10)).await;44(45format!("{a} - entered host - exited host"),46b,47c,48d,49e,50f,51g,52)53}54}5556impl bindings::local::local::many::Host for Ctx {}575859