Module cstring

Module cstring 

Source
Available on crate feature cstring only.
Expand description

A dynamically sized, null terminated, C string.

Structs§

NSTDCString
A dynamically sized, null terminated, C string.

Functions§

nstd_cstring_allocator
Returns an immutable reference to a C string’s allocator.
nstd_cstring_as_bytes
Returns an immutable byte slice of the C string’s active data, including the null byte.
nstd_cstring_as_cstr
Creates a C string slice containing the contents of cstring.
nstd_cstring_as_ptr
Returns a raw pointer to a C string’s memory.
nstd_cstring_cap
Returns a C string’s capacity.
nstd_cstring_clear
Sets a C string’s length to zero.
nstd_cstring_clone
Creates a deep copy of an NSTDCString.
nstd_cstring_free
Frees an instance of NSTDCString.
nstd_cstring_from_bytes
Creates a new C string from owned data.
nstd_cstring_from_cstr
Creates an owned version of an unowned C string slice.
nstd_cstring_from_cstr_unchecked
Creates an owned version of an unowned C string slice without checking if the slice contains any null bytes.
nstd_cstring_into_bytes
Returns ownership of an NSTDCString’s raw data, taking ownership of said C string.
nstd_cstring_len
Returns the number of chars in a C string, excluding the null terminator.
nstd_cstring_len_with_null
Returns the number of chars in a C string, including the null terminator.
nstd_cstring_new
Creates a new empty NSTDCString.
nstd_cstring_new_with_cap
Creates a new NSTDCString initialized with the given capacity.
nstd_cstring_pop
Removes the last character from a C string and returns it.
nstd_cstring_push
Appends an NSTDChar to the end of an NSTDCString.
nstd_cstring_push_cstr
Appends a C string slice to the end of a C string.

Type Aliases§

NSTDOptionalCString
Represents an optional value of type NSTDCString.