const unsafe fn strlen(ptr: *const c_char) -> usize
🔬This is a nightly-only experimental API. (
cstr_internals
)Expand description
Calculate the length of a nul-terminated string. Defers to C’s strlen
when possible.
§Safety
The pointer must point to a valid buffer that contains a NUL terminator. The NUL must be
located within isize::MAX
from ptr
.