1 2 3 4 5 6 7 8 9 10
#[link(wasm_import_module = "Android")] unsafe extern "C" { fn show_toast_impl(ptr: *const u8, len: usize); } pub fn show_toast(msg: &str) { unsafe { show_toast_impl(msg.as_ptr(), msg.len()); } }