Relative Content

Tag Archive for rustrust-rocket

Is there panic recovery in rust rocket?

I have been using go fiber and now trying rust rocket framework and realize that in go fiber you can recover from panic using middleware recover link, so is there anything like it in rust rocket framework? If not then how can I implement it manually I thought maybe using fairings so if I get panic then send JSON response “500 Internal Server Error” instead of crashing the app.

How to run rocket code from another file?

I can’t launch my rocket code from my main file main.rs. I want my main code to run in parallel with the rocket code and remain in the background until I close the process in the terminal.

How to replace clone calls in Rust?

I have a fairly large Rust application, and, as I was scrolling through it, I realized that I had many clone calls. Is it considered evil or at least not best practice to have many calls of clone?If so, what is the idiomatic method of replacing clone?
Here is a startup function for rocket: