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

Creates a new string from owned UTF-8 data.

Parameters:

  • NSTDVec bytes - The owned UTF-8 encoded buffer to take ownership of.

Returns

NSTDOptionalString string - The new UTF-8 encoded string with ownership of bytes on success or an uninitialized “none” variant if bytes contains invalid UTF-8.

Panics

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