Path: blob/main/crates/test-programs/src/bin/async_backpressure_callee.rs
3088 views
mod bindings {1wit_bindgen::generate!({2path: "../misc/component-async-tests/wit",3world: "backpressure-callee",4});56use super::Component;7export!(Component);8}910use bindings::exports::local::local::{backpressure::Guest as Backpressure, run::Guest as Run};1112struct Component;1314impl Run for Component {15async fn run() {16// do nothing17}18}1920impl Backpressure for Component {21fn set_backpressure(enabled: bool) {22if enabled {23wit_bindgen::backpressure_inc();24} else {25wit_bindgen::backpressure_dec();26}27}28fn inc_backpressure() {29wit_bindgen::backpressure_inc();30}31fn dec_backpressure() {32wit_bindgen::backpressure_dec();33}34}3536// Unused function; required since this file is built as a `bin`:37fn main() {}383940