Method lrs::string::CStr::from_ptr

Creates a new CStr from a pointer.

Syntax

impl CStr {
    unsafe fn from_ptr(ptr: *const i8) -> &'static CStr
}

Arguments

NameDescription
ptr

A pointer to a null-terminated string.

Remarks

If ptr is not a null terminated array of bytes, the behavior is undefined.