Function with_cstring

Source
pub fn with_cstring<T, E: From<Error>>(
    s: String,
    f: impl FnOnce(CString<'_>) -> Result<T, E>,
) -> Result<T, E>
Expand description

Calls the given function with a lifetime-bound CString constructed from the given String.