Skip to main content

lift_str_param

Function lift_str_param 

Source
pub unsafe fn lift_str_param<'a>(
    ptr: *const u8,
    len: usize,
    name: &str,
) -> Result<&'a str, FfiError>
Expand description

Borrow a string parameter’s UTF-8 (ptr, len) run as a &str.

§Errors

Returns a marshalling error for null with a non-zero length or bytes that aren’t UTF-8.

§Safety

Same contract as lift_byte_slice.