Function nstd_sys::string::nstd_string_new_with_cap
source · #[no_mangle]
pub extern "C" fn nstd_string_new_with_cap(
cap: NSTDUInt
) -> NSTDStringAvailable on crate feature
nstd_string only.Expand description
Creates a new string initialized with the given capacity.
Parameters:
NSTDUInt cap- The number of bytes to allocate ahead of time.
Returns
NSTDString string - The new string.
Panics
This function will panic if cap is zero.
Example
use nstd_sys::string::nstd_string_new_with_cap;
let string = nstd_string_new_with_cap(20);