Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/test-programs/src/bin/async_backpressure_callee.rs
1693 views
1
mod bindings {
2
wit_bindgen::generate!({
3
path: "../misc/component-async-tests/wit",
4
world: "backpressure-callee",
5
});
6
7
use super::Component;
8
export!(Component);
9
}
10
11
use bindings::exports::local::local::{backpressure::Guest as Backpressure, run::Guest as Run};
12
13
struct Component;
14
15
impl Run for Component {
16
async fn run() {
17
// do nothing
18
}
19
}
20
21
impl Backpressure for Component {
22
fn set_backpressure(enabled: bool) {
23
wit_bindgen::backpressure_set(enabled);
24
}
25
}
26
27
// Unused function; required since this file is built as a `bin`:
28
fn main() {}
29
30