wit-bindgen-cli 0.57.1

CLI tool to generate bindings for WIT documents and the component model.
use wit_bindgen::FutureReader;

include!(env!("BINDINGS"));

struct Component;

export!(Component);

impl crate::exports::my::test::i::Guest for Component {
    async fn ping(x: FutureReader<String>, y: String) -> FutureReader<String> {
        let msg = x.await + y.as_str();
        let (tx, rx) = wit_future::new(|| unreachable!());
        wit_bindgen::spawn(async move {
            tx.write(msg).await.unwrap();
        });
        rx
    }

    async fn pong(x: FutureReader<String>) -> String {
        x.await
    }
}