Macro valence::ident

macro_rules! ident {
    ($string:literal) => { ... };
}
Expand description

Creates a new Ident at compile time from a string literal. A compile error is raised if the string is not a valid resource identifier.

The type of the expression returned by this macro is Ident<&'static str>. The expression is usable in a const context.

ยงExamples

let my_ident: Ident<&'static str> = ident!("apple");

println!("{my_ident}");