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_direct.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-direct",
9
});
10
}
11
12
impl bindings::RoundTripDirectImportsWithStore for Ctx {
13
async fn foo<T>(_: &Accessor<T, Self>, s: String) -> String {
14
crate::util::sleep(Duration::from_millis(10)).await;
15
format!("{s} - entered host - exited host")
16
}
17
}
18
19
impl bindings::RoundTripDirectImports for Ctx {}
20
21