1
use std::os::raw::c_char;
2
3
#[no_mangle]
4
pub extern "C" fn rust_function(name: *const c_char) {
5
let name = unsafe { std::ffi::CStr::from_ptr(name).to_str().unwrap() };
6
println!("Hello, {}! I'm Rust!", name);
7
}
8