Expand description
A library to build literal-based singleton types and values.
§Usage
Apply the literal attribute to a struct with a string, integer, float, or boolean literal.
use literalize::literal;
#[literal("not_found")]
struct NotFound;
#[literal(404)]
struct HttpNotFound;
#[literal(3.14)]
struct Pi;
#[literal(true)]
struct LiteralTrue;§Features
Modules§
- serde
- Serde integration.
Attribute Macros§
- literal
- Build a literal-based singleton type and value.