macro_rules! c_str {
($s:expr) => { ... };
}Expand description
This is a helper macro to create a &'static CStr.
It can be used on all Rust versions supported by PyForge, unlike cāā literals which were stabilised in Rust 1.77.
Due to the nature of PyForge making heavy use of C FFI interop with Python, it is common for PyForge to use CStr.
Examples:
use std::ffi::CStr;
const HELLO: &CStr = pyo3_ffi::c_str!("hello");
static WORLD: &CStr = pyo3_ffi::c_str!("world");