Skip to main content

fill_string_callback

Function fill_string_callback 

Source
unsafe extern "C" fn fill_string_callback(
    ptr: *const c_char,
    len: usize,
    target: *mut c_void,
)
Expand description

Append a C string of len bytes into a Rust String pointed to by target

The C string is expected to be utf-8 encoded. If it is not, the conversion will be lossy.

ยงSafety

  • target must be a valid *mut String, with no other active borrows.
  • ptr must point to a C char* array of len bytes.