Module cstr

Module cstr 

Source
Available on crate feature core only.
Expand description

Unowned C string slices.

Modules§

raw
Raw C string processing.

Structs§

NSTDCStr
An immutable slice of a C string.
NSTDCStrMut
A mutable slice of a C string.

Functions§

nstd_core_cstr_as_bytes
Returns a byte slice of a C string slice’s data.
nstd_core_cstr_as_ptr
Returns a pointer to the first character in a C string slice.
nstd_core_cstr_first
Returns a pointer to the first character in a C string slice, or null if it is empty.
nstd_core_cstr_from_raw
Creates a new instance of NSTDCStr from a raw C string, excluding the null byte.
nstd_core_cstr_from_raw_with_null
Creates a new instance of NSTDCStr from a raw C string, including the null byte.
nstd_core_cstr_get
Return a pointer to the character at index pos in cstr.
nstd_core_cstr_get_null
Returns a pointer to the first null byte in a C string slice if one is present.
nstd_core_cstr_is_null_terminated
Determines whether or not a C string slice is null terminated. This will return false if the C string slice contains any null bytes before the last byte.
nstd_core_cstr_last
Returns a pointer to the last character in a C string slice, or null if it is empty.
nstd_core_cstr_len
Returns the length of a C string slice.
nstd_core_cstr_mut_as_bytes
Returns a byte slice of a C string slice’s data.
nstd_core_cstr_mut_as_const
Creates an immutable version of a mutable C string slice.
nstd_core_cstr_mut_as_ptr
Returns a pointer to the first character in a C string slice.
nstd_core_cstr_mut_as_ptr_const
Returns a pointer to the first character in a C string slice.
nstd_core_cstr_mut_first
Returns a pointer to the first character in a C string slice, or null if it is empty.
nstd_core_cstr_mut_first_const
Returns an immutable pointer to the first character in a C string slice, or null if it is empty.
nstd_core_cstr_mut_from_raw
Creates a new instance of NSTDCStrMut from a raw C string, excluding the null byte.
nstd_core_cstr_mut_from_raw_with_null
Creates a new instance of NSTDCStrMut from a raw C string, including the null byte.
nstd_core_cstr_mut_get
Return a pointer to the character at index pos in cstr.
nstd_core_cstr_mut_get_const
Return an immutable pointer to the character at index pos in cstr.
nstd_core_cstr_mut_get_null
Returns a pointer to the first null byte in a C string slice if one is present.
nstd_core_cstr_mut_get_null_const
Returns an immutable pointer to the first null byte in a C string slice if one is present.
nstd_core_cstr_mut_is_null_terminated
Determines whether or not a C string slice is null terminated. This will return false if the C string slice contains any null bytes before the last byte.
nstd_core_cstr_mut_last
Returns a pointer to the last character in a C string slice, or null if it is empty.
nstd_core_cstr_mut_last_const
Returns an immutable pointer to the last character in a C string slice, or null if it is empty.
nstd_core_cstr_mut_len
Returns the length of a C string slice.
nstd_core_cstr_mut_new
Creates a new C string slice from a raw pointer and a size.
nstd_core_cstr_mut_new_unchecked
Creates a new C string slice from a raw pointer and a size without checking if raw is null.
nstd_core_cstr_new
Creates a new C string slice from a raw pointer and a size.
nstd_core_cstr_new_unchecked
Creates a new C string slice from a raw pointer and a size without checking if raw is null.

Type Aliases§

NSTDOptionalCStr
Represents an optional value of type NSTDCStr.
NSTDOptionalCStrMut
Represents an optional value of type NSTDCStrMut.