A library to build literal-based singleton types and values.
To install this package, run the following command:
cargo add literalizeApply 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;serde- ImplementDeserializeandSerializefromserde.utoipa- ImplementToSchemafromutoipa.all- Enable all features.
For contributing, please refer to the contributing guide.
This project is licensed under the terms of the MIT license.