标签: rust
与该标签相关的所有文章 "rust".
-
Rust Web:Axum Extractor Rejection-Handler 执行前的守门员
extractor 从请求中提取数据时,可能失败。失败时产生的东西叫 Rejection。
-
Rust Web:Actix-web HTTP Server 指南
Actix-web 是 Rust 生态中最成熟的 Web 框架之一,性能极强,功能全面,开箱即用。
-
tower(四):tower-http-HTTP 专用中间件
tower-http 提供 20+ 个 HTTP 专用中间件 (压缩、CORS、Tracing、Header 操作等), 它们构建在 tower 的泛型 Service trait 之上, 兼容任何使用 http + http-body crate 的框架 -- axum、hyper、tonic 都能直接使用, 不需要每个框架重复实现.
-
tower(三):内置中间件-限流、重试、超时与缓冲
tower 提供协议无关的通用中间件, 每个都通过 feature flag 独立启用. 核心六个: ConcurrencyLimit (并发数上限), RateLimit (速率限制), Timeout (超时), Retry (重试 + Policy trait), Buffer (mpsc 通道使 Service 可 Clone), LoadShed (过载丢弃). 它们与 tower-http 的 HTTP 专用中间件互补而非重复.