1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Core type definitions and aliases used throughout the Tako framework.
//!
//! This module provides fundamental type aliases that standardize the types used across
//! the framework for requests, responses, errors, and middleware. These aliases ensure
//! consistency and make the API more ergonomic by hiding complex generic parameters.
//! The main types include `Request` and `Response` for HTTP handling, and `BoxMiddleware`
//! for middleware function composition.
//!
//! # Examples
//!
//! ```rust
//! use tako::types::{Request, Response, BoxMiddleware};
//! use tako::middleware::Next;
//! use std::sync::Arc;
//!
//! // Using the Request type in a handler
//! async fn handler(req: Request) -> Response {
//! Response::new(tako::body::TakoBody::from("Hello, World!"))
//! }
//!
//! // Creating middleware using BoxMiddleware
//! let middleware: BoxMiddleware = Arc::new(|req, next| {
//! Box::pin(async move {
//! println!("Request to: {}", req.uri());
//! next.run(req).await
//! })
//! });
//! ```
use Arc;
use Bytes;
use BoxFuture;
use UnsyncBoxBody;
use crateTakoBody;
use crateNext;
/// HTTP request type with streaming body support (hyper-independent).
pub type Request = Request;
/// HTTP response type with Tako's custom body implementation.
pub type Response = Response;
/// Boxed HTTP body type for internal response handling.
pub type BoxBody = ;
/// Boxed error type for thread-safe error handling.
pub type BoxError = ;
/// Boxed middleware function type for dynamic middleware composition.
pub type BoxMiddleware = ;
pub type BuildHasher = RandomState;
pub type BuildHasher = RandomState;