Expand description
A multi-transport Rust framework for modern network services.
Tako is built for services that go beyond plain HTTP. It gives you one cohesive model for routing, extraction, middleware, streaming, observability, and graceful shutdown across several protocols and transport layers.
§Why Tako
- One application can expose HTTP APIs, realtime channels, and raw transports without switching frameworks.
- The same ergonomic handler and extractor model applies across higher-level web routes and lower-level network services.
- Platform primitives such as middleware, queues, signals, streaming, metrics, and file serving are part of the framework story.
- You can stay on the default
tokioruntime or opt intocompiowhere it is a better fit.
§High-level features
- Multi-transport support: HTTP/1.1, HTTP/2, HTTP/3, WebSocket, SSE, gRPC, TCP, UDP, Unix sockets, PROXY protocol, and WebTransport
- Dual runtime support with
tokioby default and optionalcompio - Macro-free routing with dynamic path params and TSR support
- Type-safe handlers with extractor-based arguments
- Simple
Respondertrait to return strings, tuples, or full responses - Middleware pipeline plus optional plugins for CORS, compression, rate limiting, and metrics
- Streaming bodies, file serving, range requests, and SSE helpers
- Built-in background queue and in-process signals for application workflows
- Optional GraphQL support, GraphiQL UI, and OpenAPI integrations
§Runtime support
tokiois the default runtime and powers the standard server pathcompiois available behind feature flags for teams that want an alternative async runtime modelhyper1.x remains the core HTTP engine for the default runtime path
§Best fit
Tako is a strong fit when your service needs more than REST:
- HTTP APIs plus WebSockets, SSE, gRPC, or QUIC-based transports
- Realtime coordination with built-in signals and queue primitives
- Protocol gateways, telemetry collectors, internal platforms, or edge-facing services
§Quickstart
use tako::{Method, router::Router, responder::Responder, types::Request};
async fn hello(_: Request) -> impl Responder { "Hello, World!" }
let mut router = Router::new();
router.route(Method::GET, "/", hello);§Key concepts
-
router::Router manages routes, middleware and dispatch.
-
extractors parse request data (headers, params, JSON, forms, etc.).
-
responder::Responder converts return values into HTTP responses.
-
middleware composes cross-cutting concerns.
-
Static file serving (module
static) and file_stream provide static and streaming file responses. -
[ws] and sse enable real-time communication.
-
queue and signals provide built-in application coordination primitives.
-
plugins add CORS, compression, and rate limiting (feature:
plugins). -
graphql and graphiql add GraphQL support (feature:
async-graphql/graphiql).
§Feature flags
client— outbound HTTP clients over TCP/TLScompio— alternate runtime supportcompio-tls/compio-ws— TLS and WebSocket support on compiofile-stream— file streaming utilitieshttp2— enable ALPN h2 in TLS serverhttp3— HTTP/3 over QUICjemalloc— use jemalloc as global allocatormultipart— multipart form-data extractorsplugins— CORS, compression, rate limitingprotobuf— protobuf extractors (prost)simd— SIMD JSON extractor (simd-json)signals— in-process pub/sub and RPC-style signalingtls— TLS server (rustls)tako-tracing— structured tracing subscriberutoipa/vespera— OpenAPI integrationswebtransport— QUIC-based WebTransport sessionszero-copy-extractors— zero-copy extraction helperszstd— Zstandard compression option within plugins::compression
Re-exports§
pub use responder::NOT_FOUND;pub use server_compio::serve;compiopub use server_compio::serve_with_shutdown;compiopub use server_tls_compio::serve_tls;tlspub use server_tls_compio::serve_tls_with_shutdown;tls
Modules§
- body
- HTTP request and response body handling utilities. HTTP request and response body handling utilities for efficient data processing.
- config
- Configuration loading from environment variables. Configuration loading from environment variables.
- extractors
- Request data extraction utilities for parsing query params, JSON, and more. HTTP request data extraction utilities and traits.
- file_
stream file-stream - File streaming utilities for serving files. File streaming utilities for efficient HTTP file delivery.
- graphiql
graphiql - GraphiQL UI helpers. GraphiQL HTML responder and helper for Tako.
- graphql
async-graphql - GraphQL support (request extractors, responses, and subscriptions). Async-GraphQL integration for Tako: extractors, responses, and subscriptions.
- grpc
grpc - gRPC support for unary RPCs with protobuf serialization. gRPC support for unary RPCs over HTTP/2.
- header
- HTTP header types
- middleware
- Middleware for processing requests and responses in a pipeline. Middleware system for request and response processing pipelines.
- openapi
utoipaorvespera - OpenAPI documentation generation integrations (utoipa, vespera). OpenAPI documentation generation integrations.
- plugins
plugins - Plugin system for extending framework functionality. Plugin system for extending framework functionality with composable modules.
- queue
- In-memory background job queue with retry, delayed jobs, and dead letter support. In-memory background job queue with named queues, retry policies, and dead letter support.
- redirect
- Redirection utilities for handling HTTP redirects. Redirect response utilities for handlers.
- responder
- Response generation utilities and traits. Response generation utilities and trait implementations for HTTP responses.
- router
- Request routing and dispatch functionality. HTTP request routing and dispatch functionality.
- server_
compio compio - Compio server implementation for efficient I/O operations.
- server_
tcp - Raw TCP server for handling arbitrary TCP connections. Raw TCP server for handling arbitrary TCP connections.
- server_
tls_ compio compioandtls - TLS-enabled HTTP server implementation for secure connections (compio runtime).
- server_
udp - UDP datagram server for handling raw UDP packets. UDP datagram server for handling raw UDP packets.
- signals
signals - In-process signal arbiter for custom events. In-process signal arbiter and dispatch system.
- sse
- Server-Sent Events (SSE) support for real-time communication. Server-Sent Events (SSE) implementation for real-time data streaming.
- state
- Application state management and dependency injection. Global application state management and dependency injection (type-based).
- static
- Static file serving utilities. Static file serving utilities for web applications.
- tracing
tako-tracing - Distributed tracing integration for observability. Distributed tracing integration for observability and debugging.
- types
- Core type definitions used throughout the framework. Core type definitions and aliases used throughout the Tako framework.
- ws_
compio compio-ws - WebSocket connection handling for compio runtime. WebSocket connection handling for compio runtime.
- zero_
copy_ extractors zero-copy-extractors
Structs§
- Bytes
- A cheaply cloneable and sliceable chunk of contiguous memory.
- Full
- A body that consists of a single chunk.
- Method
- The Request Method (VERB)
- Status
Code - An HTTP status code (
status-codein RFC 9110 et al.).
Functions§
- bind_
with_ port_ fallback compio - Bind a TCP listener for
addr, asking interactively to increment the port if it is already in use (compio version).