Reimplement library on top of rustls::KernelConnection
#61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR isn't quite complete yet but as I keep pushing forward with it I find that I'm basically rewriting the whole crate here. I would like to get some feedback on whether this direction is worth continuing in this direction before I finish + polish up the remaining parts of the PR.
TL;DR: Is it OK if I basically end up rewriting the whole crate here?
Here's how the code looks now:
KTlsStreamImpltype. This is generic so that it can be shared between the different connection types but generics needed to do this are rather messy so it is hidden from the public API.KTlsClientStream,KTlsServerStream, andKTlsStreamwhich are on top ofKTlsStreamImpland work how you would expect them to.KTlsConnectorandKTlsAcceptor(similarly to how it works intokio-rustls)I've also made some smaller changes:
io::Error)Here's things that can no longer be supported and/or are no longer necessary:
KTlsStreamfrom atokio_rustls::TlsStream.TlsStreamis built on top ofClientConnection/ServerConnectionbut creating aKernelConnectionrequires an unbuffered connection.CorkStreamis no longer necessary along with a few other methods.TODOs:
Fixes #59