Function dummy_rustwlc::pointer_to_string
[−]
[src]
pub unsafe fn pointer_to_string(pointer: *const c_char) -> String
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.
rust 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); }