Tries to create a CStr without copying and copies if that's not possible.
fn to_or_as_cstr(&'a self, buf: &'a mut [u8]) -> Result<&'a CStr, Errno>
| Name | Description |
|---|---|
| buf | The buffer in which the |
Returns the borrowed or created CStr.
For example, "Hello World\0" does not have to be copied. The default implementation simply calls to_cstr.