1 use test_programs::p3::*; 2 3 struct Component; 4 5 export!(Component); 6 7 impl exports::wasi::cli::run::Guest for Component { 8 async fn run() -> Result<(), ()> { 9 let (mut tx, rx) = wit_stream::new(); 10 futures::join!( 11 async { 12 wasi::cli::stdout::write_via_stream(rx).await.unwrap(); 13 }, 14 async { 15 tx.write(b"hello, world\n".to_vec()).await; 16 drop(tx); 17 }, 18 ); 19 Ok(()) 20 } 21 } 22 23 fn main() { 24 panic!("should call p3 entrypoint"); 25 } 26