Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[suggestion] Handler trait #2092

Closed
petar-dambovaliev opened this issue Jan 28, 2022 · 1 comment
Closed

[suggestion] Handler trait #2092

petar-dambovaliev opened this issue Jan 28, 2022 · 1 comment
Labels
suggestion A suggestion to change functionality

Comments

@petar-dambovaliev
Copy link

petar-dambovaliev commented Jan 28, 2022

There doesn't seem to be a handler trait that clearly establishes an interface between the application and the user handler functions.
At our company, we created a tracing_rocket crate which allows for open telemetry spans (by implementing additional features in the macros) from the code calling the user defined handler.
We use that, instead of the rocket macros that generate handlers.

When you combine that (not having a contract) with the fact that part of the application routing is happening inside the generated handler (forwarding), it leaves a lot of room for our crate breaking on a "non breaking change" in rocket.

@petar-dambovaliev petar-dambovaliev added the suggestion A suggestion to change functionality label Jan 28, 2022
@SergioBenitez
Copy link
Member

There are in fact two Handler traits:

But I think solving #21 (via #1410) might actually be what you'd want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion A suggestion to change functionality
Projects
None yet
Development

No branches or pull requests

2 participants