当前位置:网站首页>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 .
边栏推荐
- Matlab saves triangulation results as STL files
- 2022-06-30: what does the following golang code output? A:0; B:2; C: Running error. package main import “fmt“ func main()
- leetcode 474. Ones and zeroes (medium)
- 206页上海BIM技术应用与发展报告2021
- Why should VR panoramic shooting join us? Leverage resources to achieve win-win results
- What is SRM system and how to standardize the internal procurement process of the company
- When we look at the industrial Internet, we always look at it from the opposite of the consumer Internet
- How does the VR cloud exhibition hall bring vitality to offline entities? What are the functions?
- Dataloader source code_ DataLoader
- 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
猜你喜欢
![[designmode] factory pattern](/img/62/9be808b3e1c2139d564caa307fcd30.png)
[designmode] factory pattern

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

Design e-commerce seckill system
![[leetcode] [SQL] notes](/img/8d/160a03b9176b8ccd8d52f59d4bb47f.png)
[leetcode] [SQL] notes

Redis - 01 cache: how to use read cache to improve system performance?

Prospects of world digitalization and machine intelligence in the next decade

Which is better, server rental or hosting services in the United States?

Software engineering best practices - project requirements analysis

In depth understanding of jetpack compose kernel: slottable system
![Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical](/img/ce/519778cd731f814ad111d1e37abd10.png)
Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical
随机推荐
Fund managers' corporate governance and risk management
How do I open a stock account on my mobile phone? In addition, is it safe to open a mobile account?
C language array interception, C string by array interception method (c/s)
Reason why wechat payment wxpaypubhelper V3 callback XML is empty
DNS server setup, forwarding, master-slave configuration
Is it safe to choose mobile phone for stock trading account opening in Hangzhou?
Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical
一次革命、两股力量、三大环节:《工业能效提升行动计划》背后的“减碳”路线图
CentOS 6.3 x64 PHP 5.2.6 扩展安装OpenSSL出错的解决方法
IFLYTEK active competition summary! (12)
五分钟搞懂探索式测试
[leetcode] [SQL] notes
Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical
Is it safe to choose mobile phone for stock trading account opening in Guangzhou?
What does project management really manage?
网上开华泰证券的股票账户是否安全呢?
Never use redis expired monitoring to implement scheduled tasks!
76页智慧物流园区综合解决方案2022(附下载)
Shell multitasking to download video at the same time
Pycharm is very fast to learn from installation to full armament. There are so many pictures because it is too detailed!