Registry / utility / const-cstr

const-cstr

JSON →
library0.3.0rscratesunverified

Create static C-compatible strings from Rust string literals.

# Cargo.toml [dependencies] const-cstr = "0.3.0"
INSTALL
IMPORT
SIG · CONST-CSTR
C
const-cstr
utilityrustv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

const_cstr
✓ use const_cstr::const_cstr;

Create a compile-time C string from a Rust literal.

use const_cstr::const_cstr; const MY_CSTR: &'static std::ffi::CStr = const_cstr!("hello"); fn main() { println!("C string: {:?}", MY_CSTR); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.3.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
const-cstr — cargo add const-cstr · libregistry