#[no_mangle]
pub extern "C" fn nstd_cstring_from_bytes(
    bytes: NSTDVec<'_>
) -> NSTDOptionalCString<'_>
Available on crate feature cstring only.
Expand description

Creates a new C string from owned data.

Parameters:

  • NSTDVec bytes - The bytes to take ownership of.

Returns

NSTDOptionalCString cstring - The new C string with ownership of bytes on success, or an uninitialized “none” variant if bytes does not end with a null (\0) byte.

Panics

This operation will panic if bytes’s stride is not 1.