During smol-rs/async-rustls#9, @zseri pointed out that we frequently use a type that just converts an AsyncRead to a Read temporarily so that it can be used in rustls, which only takes a Read. This pattern is not unique to async-rustls, since I've also seen this used in tokio-tungstenite, following a similar pattern.
In order to deduplicate instances of this pattern throughout the ecosystem, this PR implements this pattern as a type in the io module.
During smol-rs/async-rustls#9, @zseri pointed out that we frequently use a type that just converts an
AsyncRead
to aRead
temporarily so that it can be used inrustls
, which only takes aRead
. This pattern is not unique toasync-rustls
, since I've also seen this used intokio-tungstenite
, following a similar pattern.In order to deduplicate instances of this pattern throughout the ecosystem, this PR implements this pattern as a type in the
io
module.