Function std::str::from_c_strUnstable
[-]
[+]
[src]
pub unsafe fn from_c_str(s: *const i8) -> &'static str
Constructs a static string slice from a given raw pointer.
This function will read memory starting at s until it finds a 0, and then
transmute the memory up to that point as a string slice, returning the
corresponding &'static str value.
This function is unsafe because the caller must ensure the C string itself
has the static lifetime and that the memory s is valid up to and including
the first null byte.
Panics
This function will panic if the string pointed to by s is not valid UTF-8.