1 2 3 4 5 6 7
use std::ffi::{CStr, CString}; use std::os::raw::c_char; #[no_mangle] pub extern "C" fn ruida_hello() -> *const c_char { CString::new("Hello from Rust").unwrap().into_raw() }