当前位置:网站首页>Tide - rust web framework based on async STD
Tide - rust web framework based on async STD
2022-06-30 23:58:00 【ruonou. com】
Tide It is small and practical Rust web Application framework , Build for rapid development . It provides a robust set of features , Make build asynchronous web Applications and API It's easier 、 More interesting .
In the following example , Will be created HTTP The server , receive JSON Text , Verify it , And respond with a confirmation message . Let's see how simple it is ——
use tide::prelude::*;
use tide::Request;
#[derive(Debug, Deserialize)]
struct Animal {
name: String,
legs: u8,
}
#[async_std::main]
async fn main() -> tide::Result<()> {
tide::log::start();
let mut app = tide::new();
app.at("/orders/shoes").post(order_shoes);
app.listen("127.0.0.1:8080").await?;
Ok(())
}
async fn order_shoes(mut req: Request<()>) -> tide::Result {
let Animal { name, legs } = req.body_json().await?;
Ok(format!("Hello, {}! I've put in an order for {} shoes", name, legs).into())
}
Compare with actix-web, I prefer it Tide. I used to be actix-web user , It has been developed based on actix-web、juniper(Rust Of graphql Realization )、postgresql、react Waiting web Comprehensive application , But after my comparison , More interest in Tide and async-graphql above .
Because I like , So I recommend it to all friends .
Tide stay Practical examples of production environments project , see also yazhijia(github Warehouse )( Will continue to upgrade )
- pure Rust Blog system implemented by technology stack , If you are interested, please visit the demo site :https://blog.budshome.com.
- Back end (backend) Mainly provide graphql service , Used tide, async-graphql, jsonwebtoken, mongodb And so on crate.
- front end (frontend) Provide web Application service , Used tide, rhai, surf, graphql_client, handlebars-rust, cookie And so on crate.
About the clean template project , Adopted Pure Rust Technology stack . Include ( Will continue to upgrade ):
- Rust - A collection of Chinese materials
- Tide - Chinese document
- async-graphql - Chinese document
- mongodb & mongo-rust-driver
- Surf
- graphql_client
- handlebars-rust
- jsonwebtoken
- cookie-rs
see also github Warehouse tide-graphql-mongodb. At present, the following functions have been realized ( Will continue to upgrade ):
- User registration
- Use PBKDF2 Encrypt password (salt) And hash (hash) operation
- Integrate JWT Authenticated user login
- Password change
- Data update
- User queries and changes
- Project inquiry and change
- Using a Rust Realization graphql-client obtain GraphQL Server data
- Rendering GraphQL Data to handlebars-rust template engine
Thank you for reading .
边栏推荐
- Quick start of wechat applet -- project introduction
- New trend of embedded software development: Devops
- Sm2246en+ SanDisk 15131
- 股票开户要如何办理呢?办理手机开户安全吗
- Qt笔记(七十四)之QLineEdit指定输入类型
- Query points in MATLAB Delaunay triangulation
- LVM snapshot: backup based on LVM snapshot
- How do it outsourcing resident personnel position their pain points?
- Development of wireless U-shaped ultrasonic electric toothbrush
- To tell you the truth, ThreadLocal is really not an advanced thing
猜你喜欢

MaxPool2d详解--在数组和图像中的应用

VR panorama adds contrast function to make the display of differentiation effect more intuitive!

Solution to the conflict between unique index and logical deletion

When is it appropriate to replace a virtual machine with a virtual machine?

In 2022, the latest JCR officially released the list of the latest global impact factors (top 600)

New trend of embedded software development: Devops

BeanUtils. Copyproperties() vs. mapstruct

6-1 exploit -ftp exploit

未来十年世界数字化与机器智能展望

Zero sample and small sample learning
随机推荐
Understand target detection in one article: r-cnn, fast r-cnn, fast r-cnn, Yolo, SSD "suggestions collection"
基金客户和销售机构
Five minutes to understand the exploratory test
New trends of China's national tide development in 2022
Fh6908a negative pole turn off synchronous rectification analog low voltage drop diode control IC chip tsot23-6 ultra low power rectifier 1W power consumption < 100ua static replacement mp6908
BeanUtils. Copyproperties() vs. mapstruct
在指南针上买基金安全吗?
LVM snapshot: preparation of backup based on LVM snapshot
Matlab saves triangulation results as STL files
Sm2246en+ SanDisk 15131
76页智慧物流园区综合解决方案2022(附下载)
In 2022, the latest JCR officially released the list of the latest global impact factors (top 600)
Ms17-010 Eternal Blue vulnerability of MSF
基金销售行为规范及信息管理
How to use robots Txt and its detailed explanation
[NLP] [textcnn] text classification
基金管理人公司治理和风险管理
How to open a stock account? Is it safe to open a mobile account
LVM snapshot: backup based on LVM snapshot
Is it safe to buy funds on the compass?