const_cstr

Macro const_cstr

Source
macro_rules! const_cstr {
    ($(pub $strname:ident = $strval:expr);+;) => { ... };
    ($strval:expr) => { ... };
    ($($strname:ident = $strval:expr);+;) => { ... };
}
Expand description

Create a C-compatible string as an rvalue or a const binding. Appends a NUL byte to the passed string.

Multiple const declarations can be created with one invocation, but only with the same visibility (pub or not).

See crate root documentation for example usage.

ยงNote

For logical consistency, the passed string(s) should not contain any NUL bytes. Remember that functions consuming a C-string will only see up to the first NUL byte.