|
|
|
|
|
by danaliv
3424 days ago
|
|
I tried to build a simple Rust "hello world" + database web app the other day (edit: not with Rocket) and after four hours I had nothing to show for it. I had a simple static app in just a few minutes, but I could not for the life of me figure out how to maintain state like a database connection pool and make it available to request handlers in any sane and maintainable way. (There are ways to do it insanely and unmaintainably for sure.) Has anyone else had this experience? |
|
Managed state is a feature specifically designed to help with this kind of thing. That being said, I still think Rocket can do more to abstract away database connections. I'm tracking improvements on this front in GitHub issue #167 [2].
[0]: https://github.com/SergioBenitez/Rocket/tree/master/examples...
[1]: https://github.com/SergioBenitez/Rocket/blob/master/examples...
[2]: https://github.com/SergioBenitez/Rocket/issues/167