You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have removed it, because this trait is impossible to implement without using alloc. And you need alloc to turn the generic H: Handler handler into a dyn Handler instance, by potentially using boxing, as in Box<dyn Handler>.
Since embedded-svc strives to have all its traits implementable in no_std and without heap allocations, I therefore removed it in later versions.
While this trait might be useful, its usage is very limited - as in it can only abstract the code that registers your handlers. Abstracting the handlers themselves is way more useful, as that way you can re-use them across many HTTP servers.
I found http client in
embedded-svc
it's a Connection wrapperembedded-svc/src/http/client.rs
Lines 7 to 11 in ad0016b
But is there any http server trait?
reference to esp-idf-svc:
https://github.com/esp-rs/esp-idf-svc/blob/2191e60cb8b85fba5e64bd09a55028955d38792d/src/http/server.rs#L405-L412
https://github.com/esp-rs/esp-idf-svc/blob/2191e60cb8b85fba5e64bd09a55028955d38792d/src/http/server.rs#L438-L440
Maybe we can use trait code as follows?
The text was updated successfully, but these errors were encountered: