h2
h2 copied to clipboard
Move codec to a separate crate
If we move the codec stuff (wire format, frames, decoding…) to a separate crate, we don't need to expose an unstable
feature and the tests won't need to reach into public-but-hidden methods.
Eh, almost seems like more hassle than it's worth, at least to me. 🤷♂️
But you wouldn't mind if I take care of the hassle, then? :)
I think there's also a maintenance cost to separating them. Keeping it in-crate allows other internal parts to access private details. Is there another thing that you hope to gain? I'd probably rather suggest, if need be, we see if can make the codec part of the library public. But hopefully for more than helping the test suite 😃
Would this make it possible to use this separate codec crate to build clients/servers that are not async?
I think, this would be amazing (for example, for building a client/server that sits directly on top of MIO, like mio_httpc (which currently doesn't implement HTTP 2), or when implementing an HTTP 2 client/server for an actor framework like Stakker. This could be interesting for performance reasons).
Or, probably more interesting, to build a blocking client/server (this could be interesting, for example, for security reasons, because sync clients/servers normally would be much simpler to implement and require fewer dependencies, compared to a high-performance async alternative).
Alternatively, maybe exposing the codec stuff and making the async parts a default feature would work too.