Replies: 1 comment
-
|
Hm. Can you describe more about what you're trying to do, maybe with an example? The problem is that with a generic function, type parameters are resolved based on what the caller provides for those types, right? And each caller providing distinct type parameters results in a new version of the generic function at compile-time. But Dropshot invokes handlers in a generic way -- it would have no way to fill in the type parameters. How would this work? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I’m experimenting with Dropshot and ran into a question about endpoint definitions.
It seems that #[endpoint] doesn’t support functions with generic parameters, or at least the macro doesn’t expand when generics are involved. Before I refactor things, I wanted to check whether this limitation is intentional, or if there’s a recommended pattern for handling shared logic that would normally use generics.
Are generic endpoints currently unsupported, and is there a preferred way to structure reusable handler code in this case?
Thanks in advance for any guidance!
Beta Was this translation helpful? Give feedback.
All reactions