Installation & features

Depend on the umbrella crate

[dependencies]
churust = "0.3"

Plugins and transports are opt-in features on churust. Prefer enabling features on the umbrella crate rather than depending on plugin crates directly:

churust = { version = "0.3", features = ["full", "ws", "fs", "tls"] }

Default features are empty: plain churust = "0.3" compiles the core engine and nothing else.

Every Churust crate is released in lockstep on one version number, so churust-core, churust-json, and the rest always match the umbrella version.

Feature matrix

FeaturePulls inGives you
jsonchurust-jsonJson<T> extractor/responder, content negotiation
loggingchurust-loggingCallLogging via tracing
corschurust-corsPreflight + CORS headers
authchurust-authBearer / Basic / JWT, Principal<P>
ratelimitchurust-ratelimitRateLimit, GCRA, keyed on the peer address
compressionchurust-compressionbrotli / gzip / deflate response bodies
templateschurust-templatesTemplates + Renderer (minijinja)
fullthe seven aboveThe whole plugin set
redischurust-redisRedisStore: server-side sessions, revocable
clientchurust-clientOutbound HTTP client (client-tls for HTTPS)
openapichurust-openapiOpenAPI 3.1 document from the router (implies json)
wschurust-core/wsWebSocket upgrade + WebSocket / Message
fschurust-core/fsStaticFiles, conditional GET, byte ranges
multipartchurust-core/multipartmultipart/form-data, buffered or streamed
tlschurust-core/tlsrustls-backed HTTPS
http3churust-core/http3HTTP/3 over QUIC (implies tls)

full enables the plugin set. Transports (ws, fs, tls, http3, multipart) stay opt-in individually — each is a protocol surface, not only an ergonomic helper.

Common combinations

# JSON API with auth and logging
churust = { version = "0.3", features = ["json", "logging", "cors", "auth"] }
# same as:
churust = { version = "0.3", features = ["full"] }

# Real-time chat
churust = { version = "0.3", features = ["ws"] }

# Static site + streaming
churust = { version = "0.3", features = ["fs"] }

# Production HTTPS
churust = { version = "0.3", features = ["tls"] }

Serde

Typed query/path/JSON bodies need Serde where you define types:

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

Tokio

Usually do not add tokio yourself. Use churust::tokio for channels, timers, and select!. If you need a tokio feature Churust does not enable, add tokio with that feature — Cargo unifies the two.

MSRV

Churust requires Rust 1.96+. CI pins that toolchain.

API reference