-
Notifications
You must be signed in to change notification settings - Fork 321
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
Use reference types in endpoints #3
Comments
Note from triage: this feature might not even be needed if we end up going with a more layered design in Tide. |
@yoshuawuyts Is there any notes on what was discussed on this? |
@mmrath if I'm remembering correctly, then by moving the extractors out of Tide's core we can simplify the design enough that this is no longer needed. The extractors would then become a concept on top of the core API. The exact semantics around that haven't been decided yet, as nailing the core API is a bit more of a priority at the moment. Does that more or less answer it? |
Yes, somewhat. I will wait for the core api design. |
Update after #156: To clarify: we'll still be able to make some API improvements once this compiler limitation is lifted. In particular, right now middleware has to pass a fully owned context downward, which means that if you want to read information out of the context afterward, you have to arrange for that separately. Ultimately, both middleware and endpoints should work with |
We've moved to only taking owned values in endpoints and that seems to be working alright for us. Once we have GATs we may be able to reconsider, but for now it seems fine. Going to go ahead and close this. |
Currently, there's no way to write a trait bound that corresponds to an
async fn
that takes borrowed arguments. Because of that restriction, endpoints have to be passed fully owned data, which forces app data to be a cloneable handle.Once rust-lang/rust#51004 is closed, revisit these APIs (which will also have an impact on the structure of
Middleware
).The text was updated successfully, but these errors were encountered: