Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/misc/component-async-tests/src/round_trip.rs
1692 views
1
use super::Ctx;
2
use std::time::Duration;
3
use wasmtime::component::Accessor;
4
5
pub mod bindings {
6
wasmtime::component::bindgen!({
7
path: "wit",
8
world: "round-trip",
9
});
10
}
11
12
pub mod non_concurrent_export_bindings {
13
wasmtime::component::bindgen!({
14
path: "wit",
15
world: "round-trip",
16
exports: { default: ignore_wit | async },
17
});
18
}
19
20
impl bindings::local::local::baz::HostWithStore for Ctx {
21
async fn foo<T>(_: &Accessor<T, Self>, s: String) -> String {
22
crate::util::sleep(Duration::from_millis(10)).await;
23
format!("{s} - entered host - exited host")
24
}
25
}
26
27
impl bindings::local::local::baz::Host for Ctx {}
28
29