Have you attempted to port an application from actix_web 0.7 to 1.0 yet? If so, how did it go? There are some significant API changes so I haven't tried yet.
In the meantime I'm learning about the migration from 0.7 to 1.0 and I'm trying to document everything I can. Something I've realized it's that is easier to create handlers and assigning it to a Server.
thanks also like to know so you know about the swift back end? I am a little bit confuse is Rust is ready for the production type of API app for a mobile app? i have my own API written in swift that's working good but i am also interested in RUST so i start to reading you post :)
I think as an API backend Rust is ready for production, might need to polish some areas but you could have your app deployed with confident. for example: figma.com/blog/rust-in-production-...
I am a product engineer and have helped build software from small startups, to manipulating hundreds of millions of data points. I write API's and make tools that make developers lives easier.
I am still going through these and am new to Rust. But being used to frameworks like flask in python, is it easy or possible to abstract out the model methods to not have the boilerplate for the db connection?
some frameworks make it so you can do request.db or maybe move it to a parent model or something? that way the model methods are a lot cleaner?
Well, I think it's possible, passing the db connection through a Trait, and then implements the trait for every model. Seems like a fun thing to do, maybe in a future post I'll try to implement it.
I am a product engineer and have helped build software from small startups, to manipulating hundreds of millions of data points. I write API's and make tools that make developers lives easier.
Thats a neat tutorial! Would like to see how we can use tokio in conjunction with actix. For eg. making multiple async calls(futures) to db, wait for all the futures, aggregate the resultset and respond to the request. I couldn't find any examples like that anywhere
impl ProductList {
pub fn list() -> Self {
ProductList(result)
}
}```
from
to
```Rust
impl Product {
pub fn list() -> Self {
ProductList(result)
}
}```
then use `Product::list()` look better and don't repeat list two times
This is a really awesome write-up, thank you!
Have you attempted to port an application from
actix_web0.7 to 1.0 yet? If so, how did it go? There are some significant API changes so I haven't tried yet.Hi, thanks.
In the meantime I'm learning about the migration from 0.7 to 1.0 and I'm trying to document everything I can. Something I've realized it's that is easier to create handlers and assigning it to a Server.
you don't have models.rs? in ur project so it confuse for newcomer :) prnt.sc/p0bfqb
Oops!, thanks for pointing this out, fixed now.
thanks also like to know so you know about the swift back end? I am a little bit confuse is Rust is ready for the production type of API app for a mobile app? i have my own API written in swift that's working good but i am also interested in RUST so i start to reading you post :)
I think as an API backend Rust is ready for production, might need to polish some areas but you could have your app deployed with confident. for example: figma.com/blog/rust-in-production-...
do you know swift back end like vapor ? if yes what you think about swift back end?
thanks
To be honest, I don't know swift, so I can't make an informed opinion about it.
Hi, your tutorial is awesome!
But I find a little issue of
dieselthat the lineuse crate::schema::products::dsl::*;in
ProductListimplementation cannot be placed in the top which will cause anunmatched typeerror ofidinfindmethod ofProductimplementation.This issue caused by a duplicated
idfromcrate::schema::products::dsl.Hi, did you take a look at the last version, sometimes I fix these issues but I forgot to mention them, github.com/practical-rust-web-deve...
Thanks for your reply. Your source code can works well.
It is my bad to take the line above to the top of the module. 😄
I am still going through these and am new to Rust. But being used to frameworks like flask in python, is it easy or possible to abstract out the model methods to not have the boilerplate for the db connection?
some frameworks make it so you can do
request.dbor maybe move it to a parent model or something? that way the model methods are a lot cleaner?Well, I think it's possible, passing the db connection through a Trait, and then implements the trait for every model. Seems like a fun thing to do, maybe in a future post I'll try to implement it.
that would be great.
Thats a neat tutorial! Would like to see how we can use tokio in conjunction with actix. For eg. making multiple async calls(futures) to db, wait for all the futures, aggregate the resultset and respond to the request. I couldn't find any examples like that anywhere
Big thanks bro....
I'm new at rust and after i read this article my mind has blow.... hha
No problem, I'm glad I could help.