Stringer
An easy way to turn an unsafe *const c_char into a Rust String type and return a pointer for FFI.
Functions
string_to_cstring
string_to_cstring
Takes a String and returns a CString.
cstr_to_string
cstr_to_string
Takes a *const c_char and returns a String.
Example on how to load this into your project:
Cargo.toml
stringer = "0.2.0"
In the file you need the functions
extern crate stringer;
use *;
Things to consider
Due to the nature of what this library is doing:
- This code is unsafe
- Use at your own risk