Crates.io | stringer |
lib.rs | stringer |
version | 0.2.0 |
created_at | 2016-05-29 04:00:37.830912+00 |
updated_at | 2025-04-17 19:48:02.31761+00 |
description | An easy way to turn an Unsafe *const c_char into a Rust String type and return a pointer. |
homepage | https://github.com/selfup/stringer |
repository | https://github.com/selfup/stringer |
max_upload_size | |
id | 5219 |
size | 6,874 |
An easy way to turn an unsafe *const c_char
into a Rust String type and return a pointer for FFI.
string_to_cstring(string: String) -> Result<CString, NulError>
Takes a String
and returns a CString
.
cstr_to_string(unsafe_string: *const c_char) -> Result<String, Utf8Error>
Takes a *const c_char
and returns a String
.
Cargo.toml
[dependencies]
stringer = "0.2.0"
In the file you need the functions
extern crate stringer;
use stringer::*;
Due to the nature of what this library is doing: