3 ms·
Yes, you can expose C symbols from a Rust library: #[no_mangle] pub extern fn rustlib_increment(x: i32) -> i32 { x + 1 } #10350 covers actually printing a
by dbaupp 12y ago
Yes, you can expose C symbols from a Rust library:
#[no_mangle]
pub extern fn rustlib_increment(x: i32) -> i32 { x + 1 }
#10350 covers actually printing a .h file from Rust code. https://github.com/rust-lang/rust/issues/10530 https://github.com/rust-lang/rust/issues/10530
- jbooth 12y agoAwesome. I think the ability to write a nice .h file, in particular, will really be the killer feature for Rust as "better systems language". Exporting headers and symbols for higher level languages in a format that's universally understood.