Module cstr

Source
Expand description

Const equivalents of CStr methods

Structs§

FromBytesUntilNulError
Error returned by from_bytes_until_nul when the input slice either does not terminate with nul.
FromBytesWithNulError
Error returned by from_bytes_with_nul when the input slice either does not terminate with nul, or contains inner nul bytes.

Functions§

from_bytes_until_nul
Converts a byte slice which contains any amount of nul bytes into a &CStr. Const equivalent of CStr::from_bytes_until_nul
from_bytes_with_nul
Converts a nul-terminated byte slice into a &CStr. Const equivalent of CStr::from_bytes_with_nul
to_bytes
Converts this CStr to a byte slice, excluding the nul terminator. Const equivalent of CStr::to_bytes
to_bytes_with_nul
Converts this CStr to a byte slice, including the nul terminator. Const equivalent of CStr::to_bytes_with_nul
to_str
Converts this CStr to a string slice, excluding the nul terminator. Const equivalent of CStr::to_str