rust-lang/rfcs — pull request #494 by alexcrichton (2014-11-30 06:46:25+00:00)
Title: RFC: Stabilize std::{c_str, c_vec}

Stabilize the `std::{c_str, c_vec}` modules by re-working their interfaces and
refocusing each primitive for one particular task. The three broad categories of
interoperating with C will work via:

1. If you have a Rust string/byte slice which needs to be given to C, then the
`CString` type will be used to statically guarantee that a terminating nul
character and no interior nuls exist.

2. If C hands you a string which you want to inspect, but not own, then a helper
function will assist in converting the C string to a byte slice.

3. If C hands you a string which you want to inspect and own, then a helper type
will consume ownership and will act as a `Box<[u8]>` in essence.