Ktor’s shape, Rust’s stack
I write a lot of Kotlin and reach for Rust when safety and performance matter. What I kept missing on the server was Ktor’s developer experience: build an application, install what you need, describe routes in one place, and ship.
Churust is that shape on tokio + hyper + rustls. The framework owns the ergonomic layer — routing, extractors, plugins, config, limits — without reinventing HTTP parsing or TLS.
What’s inside
- Hybrid handlers — call-style (
Call) or typed extractors (Path,Query,Json,State,Principal, …), mixed freely; body consumers are last-argument only, enforced by the compiler. install(plugin)— middleware into a fixed phase order (Setup → Monitoring → Plugins → Call → Fallback), so composition stays deterministic.- Secure defaults — body and connection limits, timeouts (including slow-loris-aware header reads), security headers, panic isolation, strict path policy, safe cookie defaults.
- First-party features — JSON, logging, CORS, auth (Bearer / Basic / JWT), rate limiting, compression, templates, Redis sessions, HTTP client, OpenAPI 3.1, WebSockets, static files, multipart, TLS, HTTP/2, and HTTP/3 — all opt-in via Cargo features.
- Lockstep crates — umbrella
churustplus core, macros, and plugins release on one version so the tree stays aligned.
Install
[dependencies]
churust = "0.3"
With the common plugin set and transports:
churust = { version = "0.3", features = ["full", "ws", "fs", "tls"] }
Minimal server
use churust::prelude::*;
#[churust::main]
async fn main() -> std::io::Result<()> {
Churust::server()
.port(8080)
.routing(|r| {
r.get("/", |_call: Call| async { "Hello from Churust 🌀" });
r.get("/users/{id}", |Path(id): Path<u64>| async move {
format!("user #{id}")
});
})
.start()
.await
}
Docs & source
| Resource | Link |
|---|---|
| User guide | davthecoder.github.io/Churust |
| API reference | docs.rs/churust |
| crates.io | crates.io/crates/churust |
| GitHub | github.com/davthecoder/Churust |
| Intro post | Introducing Churust |
Runnable examples in the repo: hello, api, chat, and static-example.
Frequently Asked Questions
What is Churust?
Churust is an open-source Rust web framework inspired by Kotlin’s Ktor. It provides a server builder, routing DSL, installable plugins, typed extractors, and secure-by-default configuration on top of tokio, hyper, and rustls.
Who is it for?
Backend developers who want a clear, approachable API in Rust — especially people coming from Ktor or other install-plugin frameworks — without giving up typed extractors, modern HTTP, or production-minded defaults.
Is it production-ready?
Version 0.3 is built for real services: limits, graceful shutdown, streaming, auth, sessions, broad tests, and lockstep releases. It is still pre-1.0, so pin the version and read the changelog before upgrading.
Where do I learn it?
Start with the user guide, then use docs.rs for types and the GitHub examples for full programs.