pub unsafe fn pointer_to_string(pointer: *const c_char) -> StringExpand description
Unsafe strings conversion function.
Converts a *const libc::c_char to an owned String.
Useful for log callbacks.
ยงExample
Standard usage may be for the log callbacks.
extern "C" fn default_log_callback(log_type: LogType, text: *const libc::c_char) {
let string = unsafe { pointer_to_string(text) };
println!("wlc [{:?}]: {}", log_type, string);
}