Skip to main content

lit_str

Macro lit_str 

Source
macro_rules! lit_str {
    ($struct_name:ident, $val:expr) => { ... };
}
Expand description

Creates a type that represents a specific string literal.

The generated type:

  • Has a VALUE constant with the string
  • Implements FromStr (only accepts the exact string)
  • Implements Serialize/Deserialize (as the string)
  • Implements Display (outputs the string)