rustclamp 1.0.0

A minimal synchronous entrypoint for Clamp applications.
[package]
name = "rustclamp"
version = "1.0.0"
edition = "2024"
rust-version = "1.96.1"
description = "A minimal synchronous entrypoint for Clamp applications."
repository = "https://github.com/rustclamp/rustclamp"
license = "MIT OR Apache-2.0"
homepage = "https://rustclamp.com"
documentation = "https://docs.rs/rustclamp"
keywords = ["framework", "web", "composition", "sqlite", "postgres"]
categories = ["web-programming", "rust-patterns"]
readme = "README.md"
autoexamples = false

[features]
# Optional std-only HTTP server for `clamp init --web` apps.
web = ["config", "log", "storage", "uuid"]
# Optional `.env` and environment configuration (`rustclamp::config`).
config = []
# Optional leveled logging to `storage/logs/app.log` (`rustclamp::log`).
log = ["config", "time"]
# Optional std-only UTC dates and times on SystemTime (`rustclamp::time`).
time = []
# Optional std-only files on named disks (`rustclamp::storage`).
storage = []
# Optional build-script helpers (`rustclamp::build`), such as migration discovery.
build = []
# Optional SQLite database from `.env` (`rustclamp::db`); compiles SQLite in.
db = ["config", "time", "uuid", "dep:rusqlite", "dep:rustclamp-macros"]
# Optional std-only UUID v4 and v7 (`rustclamp::uuid`); v7 comes from
# `rustclamp_core::Reference` (ADR 0021).
uuid = ["dep:rustclamp-core"]
# Optional password hashing, encryption and SHA-256/HMAC (`rustclamp::crypto`).
# Optional outgoing mail over SMTP with STARTTLS (`rustclamp::mail`, ADR 0015).
mail = ["config", "db", "log", "dep:rustls", "dep:webpki-roots"]
# Optional login, users and roles (`rustclamp::web::auth`, ADR 0013).
auth = ["web", "db", "crypto"]
# Optional Markdown to HTML that is safe to print (`rustclamp::web::markdown`).
markdown = ["web", "dep:pulldown-cmark"]
# Optional `regex:NAME` validation rule with linear-time patterns (`web::Patterns`, ADR 0033).
regex = ["web", "dep:regex"]
# Optional bounded in-process cache (`rustclamp::cache`).
cache = []
# Optional counters and gauges with a Prometheus text renderer (`rustclamp::metrics`).
metrics = []
# Optional synchronous Redis client over std TCP (`rustclamp::redis`, ADR 0027).
redis = ["config"]
# Optional background jobs (`rustclamp::queue`, ADR 0019); the Redis driver also
# needs `redis`.
queue = ["web", "db"]
# Optional scheduled tasks (`rustclamp::schedule`, ADR 0035): `schedule:run`
# from cron, or a thread beside the server outside production.
schedule = ["web", "db"]
# Optional Postgres for `rustclamp::db` (ADR 0034): a std-only wire client over TCP,
# behind `DB_CONNECTION=pgsql`.
postgres = ["db", "dep:sha2", "dep:hmac", "dep:base64ct", "dep:getrandom", "dep:rustls", "dep:webpki-roots"]
crypto = ["config", "dep:argon2", "dep:chacha20poly1305", "dep:sha2", "dep:hmac", "dep:base64ct", "dep:getrandom"]

[[example]]
name = "00-pico"
path = "examples/00-pico/main.rs"

# The phase 11 driver: admin area behind roles, contact mail through all three layers.
[[example]]
name = "blog"
path = "examples/blog/main.rs"
required-features = ["auth", "mail"]
test = true

[lints.rust]
unsafe_code = "forbid"
missing_docs = "deny"

[lints.rustdoc]
broken_intra_doc_links = "deny"

[dependencies]
rusqlite = { version = "0.40.2", features = ["bundled"], optional = true }
rustclamp-macros = { version = "1.0.0", path = "macros", optional = true }
rustclamp-core = { version = "1.0.0", git = "https://github.com/rustclamp/core", branch = "main", optional = true }
argon2 = { version = "0.6.0", optional = true }
chacha20poly1305 = { version = "0.11.0", optional = true }
sha2 = { version = "0.11.0", optional = true }
hmac = { version = "0.13.0", optional = true }
base64ct = { version = "1.8.3", features = ["alloc"], optional = true }
getrandom = { version = "0.4.3", optional = true }
rustls = { version = "0.23.45", default-features = false, features = ["ring", "std", "tls12"], optional = true }
webpki-roots = { version = "1.0.9", optional = true }
pulldown-cmark = { version = "0.13.4", default-features = false, features = ["html"], optional = true }
regex = { version = "1.13.1", default-features = false, features = ["std", "unicode-perl", "unicode-case"], optional = true }

# Local multi-repo development: build against the sibling ../core checkout instead of
# fetching it. Only applies when this repository is the build root; a project that
# depends on rustclamp through git ignores it and gets core from its repository (#86).
[patch."https://github.com/rustclamp/core"]
rustclamp-core = { path = "../core" }