krab_core
Shared runtime for the Krab full-stack Rust web framework.
krab_core holds the pieces every Krab service depends on: configuration and
secret sourcing, the HTTP layer (auth, errors, headers, observability, protocol
negotiation, runtime, security), database and migration governance, telemetry,
resilience primitives, signals, render policy, ISR, i18n, WebSockets, and server
functions.
Features
krab_core ships with no default features. Enable what you need:
| Feature | Enables |
|---|---|
rest |
Axum-based HTTP layer, JWT auth, tower middleware |
graphql |
async-graphql integration |
grpc-semantics |
gRPC status-code and timeout-header semantics for a gateway (no transport — see note below) |
auth |
Argon2id password hashing and the CredentialStore trait |
db-postgres |
sqlx Postgres access and the full migration governance surface |
db-sqlite |
sqlx SQLite driver (migration governance does not apply) |
redis-store |
Redis-backed distributed store |
web |
WASM/browser bindings (web-sys, js-sys, wasm-bindgen) |
The deprecated aliases grpc (→ grpc-semantics) and db (→ db-postgres)
were removed in 0.6.0; use the canonical names.
grpc-semanticsis not gRPC. It provides the canonical status codes andgrpc-timeoutheader parsing a gateway needs to map between HTTP and gRPC — no transport, no codegen, no.protohandling, no client.tonicandprostappear nowhere in this workspace. Bring your own transport if you need one. The feature was calledgrpcuntil ADR 0007, which is when the name stopped implying a capability the crate does not have.
Usage
[]
= { = "0.6", = ["rest", "db-postgres"] }
Documentation
Note on Node
krab_core::Node is !Send — it uses Rc via the Dynamic variant and holds
EventListener. Do not hold a Node across an .await. See
signal safety.
License
MIT