Skip to main content

lift_string

Function lift_string 

Source
pub unsafe fn lift_string(ptr: *const u8, len: usize) -> Option<String>
Expand description

Copy a (ptr, len) string parameter into an owned String, validating UTF-8.

Returns None when ptr is null but len isn’t 0, or when the bytes aren’t valid UTF-8.

§Safety

Same contract as lift_byte_slice, for the duration of the call.