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);
Modules§
- body
- HTTP request and response body handling utilities. HTTP request and response body handling utilities for efficient data processing.
- bytes
- Byte stream and buffer manipulation utilities. Byte stream and buffer manipulation utilities for efficient data handling.
- extractors
- Request data extraction utilities for parsing query params, JSON, and more. HTTP request data extraction utilities and traits.
- middleware
- Middleware for processing requests and responses in a pipeline. Middleware system for request and response processing pipelines.
- 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.
- 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.
- 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§
- Method
- HTTP method enumeration re-exported from hyper. The Request Method (VERB)
Functions§
- serve
- Starts the HTTP server with the given listener and router.