Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/misc/component-async-tests/src/sleep.rs
1692 views
1
use super::Ctx;
2
use std::time::Duration;
3
use wasmtime::component::Accessor;
4
5
wasmtime::component::bindgen!({
6
path: "wit",
7
world: "sleep-host",
8
});
9
10
impl local::local::sleep::HostWithStore for Ctx {
11
async fn sleep_millis<T>(_: &Accessor<T, Self>, time_in_millis: u64) {
12
crate::util::sleep(Duration::from_millis(time_in_millis)).await;
13
}
14
}
15
16
impl local::local::sleep::Host for Ctx {}
17
18