Skip to content
Discussion options

You must be logged in to vote

If you comment out the problematic routes function and anything else that produces hard errors, you should get a warning from the compiler about async fn in traits that tells you to refactor to -> impl Future<…> + Send. Try that.

In general, this sort of thing can be very hard. I would recommend you try to not make your router-building functions generic, and instead use dynamic dispatch for any functionality you want to conditionally swap out (e.g. your appstate might contain a Box<dyn DatabaseAccess> if you want to instantiate your router with a real DB layer for running, and with a mocked one for testing).

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lukasdietrich
Comment options

Answer selected by lukasdietrich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants