astd::ffi

Macro cstr

source
macro_rules! cstr {
    ($e:expr) => { ... };
}
Expand description

Creates a compile-time CStr object from a string literal.

This will statically verify the invariant that the CStr does not contain any embedded nul character, and will also append the trailing nul terminator.

ยงExamples


let cstr = cstr!("Hello world!");