[][src]Module tracers_core::argtypes::string

This module implements ProbeArgType and ProbeArgWrapper for Rust's string types. This implementation will be available for &String and &str on all supported platforms. On the unix family of platforms, &OsString and &OsStr are also supported.

In all four of these cases the idea is the same. The wrapper for all of the string types is Option<CString>, which will contain either nothing or a CString containing the C representation (meaning null terminated). Since Rust strings can contain embedded NULL bytes,this means that some Rust strings cannot be represented as CStrings. Hence the use of Option. If the string can't be represented as a CString, it will be passed to the C probeAPI as a NULL.