1 use anyhow::Result; 2 3 use rust_library::rust_double_value; 4 5 extern "C" { cc_double_value(value: i32) -> i326 fn cc_double_value(value: i32) -> i32; 7 } 8 9 // `tokio` currently blocked on needing the `wasm32-wasi` version of `tokio` 10 // to `select()` over different features. 11 12 // `wasm32-wasi` has limited support for `tokio` presently, so we can use the 13 // example but only with the single threaded executor. 14 // #[tokio::main(flavor = "current_thread")] 15 // async fn main() -> Result<()> { main() -> Result<()>16fn main() -> Result<()> { 17 println!("Hello World!"); 18 println!("CC: {}", unsafe { cc_double_value(5) }); 19 println!("Rust: {}", rust_double_value(5)); 20 21 Ok(()) 22 } 23