byte-strings-rs
Rust byte strings manipulation, for a better and safer C FFI

Example
Featuring the c_str!
macro to create valid C string literals with no
runtime cost!
mod puts {
use ::std::{
ffi::CStr,
os::raw::{c_char, c_int},
};
extern "C" { fn puts (message: *const c_char) -> c_int; }
pub fn safe (message: &'_ CStr) -> i32
{
unsafe {
puts(message.as_ptr()) as i32
}
}
}
use self::puts::safe as safe_puts;
fn main ()
{
use ::byte_strings::c_str;
safe_puts(
c_str!( "Hello, ",
"World!",
) );
}