Rust Web
围绕 Actix、Axum 实战、Tonic 和 Web 服务的常见问题。
-
Rust Web:服务器错误处理体系
错误来源 处理方式 最终结果 ───────────────────────────────────────────────────────────────────── 请求格式不合法 Extractor Rejection 400/401/415 (无效 JSON, 缺少 header) → handler 不执行 自动处理
-
Rust Web:Tonic gRPC Server 结构指南
minitarkovserver/ ├── Cargo.toml ├── build.rs # protobuf 编译脚本 ├── proto/ │ └── game.proto # protobuf 服务定义 └── src/ └── main.rs # server 入口
-
Rust Web:一个请求的完整生命周期
从网卡收到字节到客户端收到响应,经过的每一层,每一步。
-
Rust Web:Axum 返回值-IntoResponse 与错误处理
实现 IntoResponse trait: