#[no_mangle]
pub extern "C" fn nstd_string_push(
    string: &mut NSTDString,
    chr: NSTDUnichar
) -> NSTDErrorCode
Available on crate feature nstd_string only.
Expand description

Pushes an NSTDUnichar onto the end of a string.

Parameters:

  • NSTDString *string - The string to append the character to.

  • NSTDUnichar chr - The Unicode character to append to the string.

Returns

NSTDErrorCode errc - Nonzero on error.

Panics

Panics if the current length in bytes exceeds NSTDInt’s max value.

Example

use nstd_sys::{
    string::{nstd_string_new, nstd_string_push},
    NSTDUnichar,
};

let mut string = nstd_string_new();
assert!(nstd_string_push(&mut string, '🦀' as NSTDUnichar) == 0);