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

Consider using the http crate #55

Closed
LegNeato opened this issue Aug 4, 2023 · 2 comments
Closed

Consider using the http crate #55

LegNeato opened this issue Aug 4, 2023 · 2 comments

Comments

@LegNeato
Copy link

LegNeato commented Aug 4, 2023

It seems that embedded-svc's http service abstraction is not as mature or robust as the http crate. Is there any reason to not use the http crate directly?

@ivmarkov
Copy link
Collaborator

ivmarkov commented Aug 5, 2023

The http crate does not offer any service abstraction (traits). Please point these to me if I've missed them. What it offers instead are concrete utility types for stuff like headers, request parameters and so on. My take on these is that if you are implementing an HTTP server or client from scratch, you might consider utilizing those, but they would otherwise be a poor choice for abstracting an existing HTTP service in the embedded space, as they use allocations all over the place.

Last but not least, they are STD-only.

@ivmarkov ivmarkov closed this as completed Aug 5, 2023
@LegNeato
Copy link
Author

LegNeato commented Aug 7, 2023

Sorry, I wasn't clear and used incorrect language (and I'm not too familiar with this project or embedded so feel free to tell me to go away!)

In this project's http mod, concrete stuff like Headers, Method, and Status are defined. Those are also defined in http AFAIK, though I am not sure which require std. Additionally, in the http service definition of this crate many of the apis are "stringly" typed, which is usually a codesmell and perhaps using http's implementations where possible would add some type safety.

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

No branches or pull requests

2 participants