v2.0.0
See MIGRATION_1_TO_2.md for an upgrade walkthrough covering every breaking change, including code-mod recipes for the macros and typed-state APIs.
Added
- Per-router typed state —
Router::with_state(T)replaces the old per-typeGLOBAL_STATEslot; multiple routers in the same process can now hold independent state of the same type. - Sub-routing primitives —
Router::nest("/path", child)andRouter::scope("/api", |s| { … })replaceRouter::mergeand add a real prefix-stripping pass. Result-aware handlers — handlers may returnResult<R, E>whereE: Responder;error_handleris paired with a newclient_error_handler, anduse_problem_json()emits RFC 7807application/problem+jsonbodies.- Method-aware routing — non-matched verbs now return
405 Method Not Allowedwith the properAllowheader instead of404. Server::builder()— unified bootstrap across HTTP/1.1, HTTP/2, HTTP/3, TLS, mTLS, and Unix sockets; replaces the matrix ofserve_*/serve_tls_*entry points.- TLS knobs —
TlsCert::{Pem, Der, Resolver},ReloadableResolver,ClientAuthfor full mTLS, SNI-based cert selection, and hot reload. ConnInfo— unified peer extension; replaces theSocketAddr/UnixPeerAddrsplit.- Runtime-agnostic
ServerHandle— graceful-shutdown handle that works uniformly across the Tokio and Compio runtimes. - Thread-per-core runtime (
per-thread,per-thread-compiofeatures) — N×current-thread workers +SO_REUSEPORTbootstrap.
Changed
- MSRV: 1.95 — bumped from 1.87.
- Edition: 2024 — workspace-wide.
- Macros — route paths support both
{id}and{id: u64}forms; noParamsstruct is materialised unless a typed slot exists. - Workspace is fully publishable — every internal sub-crate now publishes on crates.io as
tako-rs-core,tako-rs-extractors,tako-rs-macros,tako-rs-plugins,tako-rs-server,tako-rs-server-pt,tako-rs-streamsalongside the umbrellatako-rscrate. Use the umbrella crate; the sub-crates are considered implementation detail. tako-core-local— the separate!Sendrouter was removed; the unifiedRouterisSend + Syncand serves both runtimes.- Compio runtime — feature flags
compio,compio-tls,compio-wsnow compose cleanly with the rest of the framework. Compio is treated as a first-class runtime alongside Tokio.
Removed
serve_*family of free functions — useServer::builder().Router::merge— usenest/scopeinstead.Router::state(T)global slot — useRouter::with_state(T).- 1.x
Paramsglobal struct — typed extractors replace it.
Security
cargo deny checkis a CI gate; the v2 advisories schema fails the build on unignored vulnerabilities, unsoundness, and unmaintained crates.- mTLS support via
ClientAuthfor hardened internal endpoints.
Deferred to 2.x (not in this release)
The migration guide enumerates these in full; tracked separately from breaking changes:
tako-stores-redis/tako-stores-postgrescompanion crates (multi-replica SessionStore / RateLimitStore / IdempotencyStore backends).TlsCert::Acme(rustls-acme integration).- HTTP/3 qlog (needs quinn bump).
- Multipart / byteranges responder + Linux
sendfile(2)path onFileStream. - Real WebTransport CONNECT handshake (currently aliased to raw-QUIC).
- gRPC reflection / health protobuf-generated stubs.
- Cluster
SignalBusRedis / NATS / Kafka implementations. - v2 client HTTP/2 + HTTP/3 + reqwest-style middleware.
- Hot-reload
Arc<Router>swap.
What's Changed
Full Changelog: v1.1.2...v2.0.0