nstd_string_new

Function nstd_string_new 

Source
#[unsafe(no_mangle)]
pub const extern "C" fn nstd_string_new( allocator: &NSTDAllocator, ) -> NSTDString<'_>
Available on crate feature string only.
Expand description

Creates a new instance of NSTDString.

§Parameters:

  • const NSTDAllocator *allocator - The memory allocator.

§Returns

NSTDString string - The new string.

§Example

use nstd_sys::{alloc::NSTD_ALLOCATOR, string::nstd_string_new};

let string = unsafe { nstd_string_new(&NSTD_ALLOCATOR) };