Route and service types #346
-
I can use a service inline:
And separately if I have a handler:
I can use it:
How can the same be done with the service, moving its body into a separate function?
Generates the error:
|
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Sep 25, 2021
Replies: 1 comment 3 replies
-
You can make a handler that calls a service and returns it's response. The most common way is |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
davidpdrsn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can make a handler that calls a service and returns it's response. The most common way is
some_service.oneshot(request).await
but there are a number useful methods ontower::ServiceExt
.