[][src]Function opaque_pointer::c::ref_str

#[must_use]pub unsafe fn ref_str<'a>(string: *const c_char) -> &'a str

Convert a reference to a C string into a static reference to Rust str.

Safety

The pointer must be a valid reference or behavior is undefined.

Panics

This could panic if the C string is not a valid UTF-8 string.