oscartbeaumont / httpz

Code once, support every Rust webserver!
MIT License
28 stars 4 forks source link

Macro or concrete version of `HttpEndpoint` trait? #4

Closed oscartbeaumont closed 2 years ago

oscartbeaumont commented 2 years ago

This is so the user of your crate doesn't need the HttpEndpoint trait in scope to call methods on it.

oscartbeaumont commented 2 years ago

I worked around needing a macro by doing Endpoint<impl HttpEndpoint> as the return type. This way we can implement all of the functions on Endpoint which is a struct hence not requiring the HttpEndpoint trait to be in scope.