Expand description
A lightweight and modular web framework for building async applications in Rust.
Tako provides core components for routing, middleware, request handling, and response
generation. The framework is designed around composable modules that can be mixed and
matched based on application needs. Key types include Router for routing requests,
various extractors for parsing request data, and responders for generating responses.
§Examples
use tako::{Method, router::Router, responder::Responder, types::Request};
async fn hello(_: Request) -> impl Responder {
"Hello, World!".into_response()
}
let mut router = Router::new();
router.route(Method::GET, "/", hello);Re-exports§
Modules§
- body
- HTTP request and response body handling utilities. HTTP request and response body handling utilities for efficient data processing.
- client
client - HTTP client implementation for making outbound requests. HTTP client implementations for making outbound requests with TLS support.
- 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.
- header
- HTTP header types
- middleware
- Middleware for processing requests and responses in a pipeline. Middleware system for request and response processing pipelines.
- plugins
plugins - Plugin system for extending framework functionality. Plugin system for extending framework functionality with composable modules.
- 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_
tls tls - TLS/SSL server implementation for secure connections. TLS-enabled HTTP server implementation for secure connections.
- 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.
- 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
- WebSocket connection handling and message processing. WebSocket connection handling and message processing utilities.
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§
- serve
- Starts the HTTP server with the given listener and router.