4 ms·
As a relative newbie in Rust who recently dabbled with Axum, I wholeheartedly agree that the handlers and extractors are magical and hard for first-time users.
by losvedir 4y ago
As a relative newbie in Rust who recently dabbled with Axum, I wholeheartedly agree that the handlers and extractors are magical and hard for first-time users. Another issue I ran into that's not mentioned in the post, is the compile-time type errors are pretty cryptic, if you get it wrong. I was trying to use the new state extractor, and didn't have my state properly wrapped in an Arc and it was complaining to me in a way that was totally unhelpful. The docs mention there's an `axum-macros` crate which can help here, but I feel like if you need macros to get around confusing type errors, you're going against the grain pretty hard.
On the whole I still found experience pretty compelling, though, as I did eventually get a little web app running with great performance and very low memory usage.
- jjwiseman 4y agoThe bad error messages are really a big deal. I like Axum, but this type-driven extractor technique leads to such awful messages for some trivial mistakes.