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

Borrow from request body in FromRequest impl #19

Closed
Ddystopia opened this issue Feb 1, 2024 · 2 comments
Closed

Borrow from request body in FromRequest impl #19

Ddystopia opened this issue Feb 1, 2024 · 2 comments

Comments

@Ddystopia
Copy link
Contributor

Hello, is there any way to express that I want to borrow from request body in FromRequest trait implementation? For example, getting &str instead of heapless::String in example.

@sammhicks
Copy link
Owner

I unfortunately ran into lifetime problems when I tried to add support for FromRequest borrowing data from the HTTP request. It's on my desired feature list, but I'm not sure that it's feasible.

@sammhicks
Copy link
Owner

I might have a solution, currently in the development branch.
Although function handlers cannot borrow from requests, I've created helper macros to allow RequestHandlerService and PathRouterService to borrow from requests.

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

No branches or pull requests

2 participants