1804060c8SJoel Dice mod bindings { 2804060c8SJoel Dice wit_bindgen::generate!({ 3804060c8SJoel Dice path: "../misc/component-async-tests/wit", 4804060c8SJoel Dice world: "round-trip", 5*020727d0SAlex Crichton async: ["-export:local:local/baz#foo"], 6804060c8SJoel Dice }); 7804060c8SJoel Dice 8804060c8SJoel Dice use super::Component; 9804060c8SJoel Dice export!(Component); 10804060c8SJoel Dice } 11804060c8SJoel Dice 121047b511SAlex Crichton use bindings::{exports::local::local::baz::Guest as Baz, local::local::baz}; 13804060c8SJoel Dice 14804060c8SJoel Dice struct Component; 15804060c8SJoel Dice 16804060c8SJoel Dice impl Baz for Component { foo(s: String) -> String17804060c8SJoel Dice fn foo(s: String) -> String { 181047b511SAlex Crichton wit_bindgen::block_on(async move { 19804060c8SJoel Dice format!( 20804060c8SJoel Dice "{} - exited guest", 21804060c8SJoel Dice baz::foo(format!("{s} - entered guest")).await 22804060c8SJoel Dice ) 23804060c8SJoel Dice }) 24804060c8SJoel Dice } 25804060c8SJoel Dice } 26804060c8SJoel Dice 27804060c8SJoel Dice // Unused function; required since this file is built as a `bin`: main()28804060c8SJoel Dicefn main() {} 29