摘要:
上一篇的hello world里,示例过于简单,仅仅只是返回了一个字符串,实际上axum的response能返回各种格式,包括: plain_texthtmljsonhttp StatusCode...web开发中需要的各种格式,都能返回。talk is cheap ,show me the cod 阅读全文
摘要:
axum是Rust生态的web框架新秀,虽然项目成立不久,但github上的star数已超2.8k,其底层依赖的是高性能的Tokio,Tokio这货就不多说了,借用知乎《深入浅出Rust异步编程之Tokio》上的一张图: Rust中的Tokio几乎是同类框架的性能天花板了,而axum在Tokio基础 阅读全文
摘要:
最基本的Hello World示例: TcpServer端: use std::{net::TcpListener, io::{Read, Write}}; fn main() { //绑定本机3000端口 let listener = TcpListener::bind("127.0.0.1:30 阅读全文