Skip to main content

Crate literalize

Crate literalize 

Source
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

  • serde - Implement Deserialize and Serialize from serde.
  • utoipa - Implement ToSchema from utoipa.
  • all - Enable all features.

Modules§

serde
Serde integration.

Attribute Macros§

literal
Build a literal-based singleton type and value.