this post was submitted on 04 Sep 2023
17 points (94.7% liked)
Rust
5938 readers
1 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Have you tried using the
#[debug_handler]
macro onget_all_armies
? Without that macro handler errors don't tell you much more than "something isn't right".Generally this kind of error indicates some type in the handler signature doesn't implement a necessary trait. Maybe you accidentally lost an automatically-derived trait like
Send + Sync
? The macro is the easiest way to check.Oh man, I didn't know debug_handler existed. Sure enough I had a missing derived attribute... not sure how but Serde serialize and deserialize were missing, so when I was trying to return Ok(Json(army)) it was failing. Thanks so much!
You're welcome!