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.
This umbrella crate stitches together the workspace sub-crates:
tako-core— routing, handlers, middleware and plugin traits, body and request types, state, signals, queue, plusGraphQL, gRPC andOpenAPIhelperstako-extractors— concrete request extractors (cookies, form, query, path, JWT, multipart, simdjson, …)tako-server— HTTP/1, TLS, HTTP/3, raw TCP / UDP / Unix, PROXY protocol, plus the compio variantstako-streams— WebSocket, SSE, file streaming, static file serving, WebTransporttako-plugins— built-in middleware (auth, CSRF, sessions, …) and plugins (CORS, compression, rate limiting, idempotency, metrics)
All public types stay reachable at the original tako::* paths.
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.
- conn_
info - Unified per-connection metadata extension shared by every transport. Unified connection-info extension shared by every Tako transport.
- extractors
- Request data extraction utilities.
- file_
stream file-stream - File streaming utilities for serving files. File streaming utilities for efficient HTTP file delivery.
- graphiql
graphiql GraphiQLUI helpers.GraphiQLHTML responder and helper for Tako.- graphql
async-graphql GraphQLsupport (request extractors, responses, and subscriptions). Async-GraphQLintegration 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.
- openapi
utoipaorvespera OpenAPIdocumentation generation integrations (utoipa, vespera).OpenAPIdocumentation generation integrations.- plugins
plugins - prelude
- Re-exports of the types most handlers reach for in everyday code.
- problem
- RFC 7807 / RFC 9457
application/problem+jsonerror responses. RFC 7807 / RFC 9457application/problem+jsonerror responses. - 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.
- route
- Route definition and matching logic. HTTP route definition and path matching functionality.
- router
- Request routing and dispatch functionality. HTTP request routing and dispatch functionality.
- router_
state - Per-router typed state container (instance-scoped, complements
state). Per-router typed state container. - server_
compio compio - server_
tcp - Raw TCP server for handling arbitrary TCP connections. Raw TCP server for handling arbitrary TCP connections.
- server_
tls_ compio compio-tls - 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 conforming to the W3C EventSource specification.
- 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.
- stores
- Pluggable backend traits for stateful middleware (sessions, rate limiting, …).
- 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 - Zero-copy extraction helpers. Zero-copy extractor variants.
Structs§
- Accept
Backoff - Exponential backoff state for
listener.accept()retry loops. - Bytes
- A cheaply cloneable and sliceable chunk of contiguous memory.
- Compio
Server compio - Compio-runtime server entry point. Construct with
CompioServer::builder. - Compio
Server Builder compio - Fluent constructor for the compio-runtime
CompioServer. - Full
- A body that consists of a single chunk.
- Method
- The Request Method (VERB)
- PerThread
Config per-thread - Configuration for
serve_per_thread(and thecompiovariant when enabled). - Server
Config - Production-readiness knobs shared by every Tako server transport.
- Server
Handle - Background-task handle returned by every
spawn_*method. - Status
Code - An HTTP status code (
status-codein RFC 9110 et al.).
Enums§
- TlsCert
- Optional TLS material the builder can attach to a TLS-mode server.
Constants§
- NOT_
FOUND - A default 404 Not Found response.
Functions§
- bind_
with_ port_ fallback - Bind a TCP listener for
addr, asking interactively to increment the port if it is already in use (compio version). - serve
- serve_
per_ thread per-thread - Starts a thread-per-core HTTP server with the given router.
- serve_
per_ thread_ compio per-thread-compio - Starts a thread-per-core HTTP server with the compio runtime.
- serve_
tls compio-tlsortls - Starts a TLS-enabled HTTP server with the given listener, router, and certificates.
- serve_
tls_ with_ shutdown compio-tlsortls - Starts a TLS-enabled HTTP server (compio) with graceful shutdown support.
- serve_
with_ shutdown - Starts the Tako HTTP server (compio) with graceful shutdown support.
Attribute Macros§
- delete
#[delete("/path", [name = "Foo"])]— shorthand for#[route(DELETE, ...)].- get
#[get("/path", [name = "Foo"])]— shorthand for#[route(GET, ...)].- patch
#[patch("/path", [name = "Foo"])]— shorthand for#[route(PATCH, ...)].- post
#[post("/path", [name = "Foo"])]— shorthand for#[route(POST, ...)].- put
#[put("/path", [name = "Foo"])]— shorthand for#[route(PUT, ...)].- route