Skip to content

Rewrite a method for a specific route, before method routing #3016

Closed Answered by edgarogh
edgarogh asked this question in Q&A
Discussion options

You must be logged in to vote

Solution:
I had a small misunderstanding, FromFn is a service and should definitely implement the Service trait. I was confusing it with FromFnLayer.
FromFn: Service wasn't satisfied because the service I was wrapping inside my layer (a MethodRouter) didn't actually implement Service for a reason that was clearly documented 🥴 (it had an explicit app state bound to it, which I needed to "erase" by providing mine explicitly).

Adding with_state at the end of my MethodRouter builder reset the explicit state to () which made it a valid service.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by edgarogh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant