1extern "C" { 2 fn js_log(ptr: *const u8, len: u32); 3} 4 5pub fn log(msg: &str) { 6 unsafe { 7 js_log(msg.as_ptr(), msg.len() as u32); 8 } 9}