---
title: "Crates"
description: "Default crates for a Rust backend service: one choice per concern, a combined Cargo.toml, and a single crypto backend."
---

> Documentation Index
> Fetch the complete documentation index at: https://codex.mirio.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Crates

One default crate per concern for a Tokio-based HTTP service, with the feature flags, the configuration that matters, and links to docs.rs, crates.io, lib.rs, and GitHub. Cryptography standardizes on `aws-lc-rs` and TLS on `rustls`, so one native crypto library backs hashing, signing, and every TLS connection in the binary. Versions are the latest stable releases as of November 2026.

## Index

| Concern                      | Crates                                                          | Page                                                |
| ---------------------------- | --------------------------------------------------------------- | --------------------------------------------------- |
| Async runtime, HTTP server   | `tokio`, `axum`                                                 | [Core](https://codex.mirio.dev/rust/crates/core/#runtime-and-http-server)  |
| HTTP client                  | `reqwest`                                                       | [Core](https://codex.mirio.dev/rust/crates/core/#http-client)              |
| Errors                       | `thiserror`, `anyhow`                                           | [Core](https://codex.mirio.dev/rust/crates/core/#errors)                   |
| Serialization                | `serde`, `serde_json`                                           | [Core](https://codex.mirio.dev/rust/crates/core/#serialization)            |
| Logs, traces, metrics        | `tracing`, `tracing-subscriber`, `tracing-ndjson`, `prometheus` | [Core](https://codex.mirio.dev/rust/crates/core/#observability)            |
| SQL                          | `sqlx`, `tokio-postgres`                                        | [Data](https://codex.mirio.dev/rust/crates/data/#database)                 |
| Date and time                | `jiff`, `jiff-sqlx`, `chrono`, `time`                           | [Data](https://codex.mirio.dev/rust/crates/data/#date-and-time)            |
| IDs and byte buffers         | `uuid`, `bytes`                                                 | [Data](https://codex.mirio.dev/rust/crates/data/#identifiers-and-buffers)  |
| Caches and concurrent maps   | `moka`, `dashmap`                                               | [Data](https://codex.mirio.dev/rust/crates/data/#caching-and-shared-state) |
| Base64 and hex               | `base64`, `hex`                                                 | [Data](https://codex.mirio.dev/rust/crates/data/#encoding)                 |
| Non-cryptographic randomness | `rand`                                                          | [Data](https://codex.mirio.dev/rust/crates/data/#random-numbers)           |
| Secrets in memory and config | `secrecy`, `zeroize`                                            | [Security](https://codex.mirio.dev/rust/crates/security/#secrets)          |
| Hashes, HMAC, passwords      | `aws-lc-rs`, `argon2`                                           | [Security](https://codex.mirio.dev/rust/crates/security/#cryptography)     |
| JWTs                         | `jsonwebtoken`                                                  | [Security](https://codex.mirio.dev/rust/crates/security/#jwts)             |
| TLS                          | `rustls`, `tokio-rustls`, `webpki-roots`, `rcgen`               | [Security](https://codex.mirio.dev/rust/crates/security/#tls)              |

## Cargo.toml

The full dependency set, with the feature flags the other pages rely on. Default features are disabled where they would pull in `ring` or an unused runtime.

```toml
[dependencies]
# Runtime and HTTP
tokio = { version = "1", features = ["macros", "rt-multi-thread", "net", "signal", "sync", "time"] }
axum = "0.8"
reqwest = { version = "0.13", features = ["json"] }

# Errors
thiserror = "2"
anyhow = "1"

# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# Observability
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-ndjson = "0.3"
prometheus = "0.14"

# Data
sqlx = { version = "0.9", default-features = false, features = [
  "runtime-tokio",
  "tls-rustls-aws-lc-rs",
  "postgres",
  "macros",
  "migrate",
  "uuid",
] }
jiff = { version = "1", features = ["serde"] }
jiff-sqlx = { version = "1", features = ["postgres"] }
uuid = { version = "1", features = ["v7", "serde"] }
bytes = "1"

# Caching and shared state
moka = { version = "0.12", features = ["future"] }
dashmap = "6"

# Encoding and randomness
base64 = "0.23"
hex = "0.4"
rand = "0.10"

# Security
secrecy = { version = "0.10", features = ["serde"] }
zeroize = { version = "1", features = ["derive"] }
aws-lc-rs = "1"
argon2 = "0.6"
jsonwebtoken = { version = "12", features = ["aws_lc_rs"] }
rustls = "0.23"
tokio-rustls = "0.26"
webpki-roots = "1"

[dev-dependencies]
rcgen = { version = "0.14", default-features = false, features = ["aws_lc_rs", "pem"] }
```

## One crypto backend

Every crate on these pages that does cryptography is pointed at `aws-lc-rs`. Most do so by default; three need a feature flag.

| Crate          | How `aws-lc-rs` is selected                                    |
| -------------- | -------------------------------------------------------------- |
| `rustls`       | Default feature `aws_lc_rs`                                    |
| `tokio-rustls` | Default feature `aws_lc_rs`                                    |
| `reqwest`      | Default feature `rustls`, which enables `aws-lc-rs`            |
| `sqlx`         | `tls-rustls-aws-lc-rs` with `default-features = false`         |
| `jsonwebtoken` | `aws_lc_rs`; no backend is enabled by default                  |
| `rcgen`        | `aws_lc_rs` with `default-features = false`; default is `ring` |

`rustls` and `jsonwebtoken` both panic at first use when more than one backend is compiled in. After adding a dependency, run `cargo tree -i ring`; it should print nothing.

Source: https://codex.mirio.dev/rust/crates/index.mdx
