Consider relaxing Unpin bound on Sink impl for FramedWrite
It appears that the Sink trait implementation for tokio_util::codec::FramedWrite requires only AsyncWrite and not AsyncWrite + Unpin. Is there a chance that futures_codec::FramedWrite could do the same?
As of today, I cannot invoke StreamExt::forward() on a futures_codec::FramedWrite which wraps a non-Unpin type.
In tokio-util, FramedWrite contains a #[pin] field of type FramedImpl (source), which contains the inner AsyncWrite field behind a #[pin] and the codec which is not (source). This means that one can do self.project() and extract the pinned AsyncWrite and unpinned codec, as needed for implementing Sink.
In this crate, however, there seems to be an extra layer: FramedWrite contains a FramedWrite2 which contains a Fuse which contains the inner AsyncWrite field and codec together. The fact that the codec is behind a Pin when it doesn't need to be unfortunately requires it to also be Unpin. Could this be restructured? Why does the double layering of FramedWrite2 and Fuse exist? Couldn't FramedWrite2 contain an inner: T and codec: E directly?
I tried to restructure and refactor this crate, WIP version @ https://github.com/YZITE/futures-codec (which e.g. gets rid of the Unpin requirement)
For future readers: since the above repo no longer exists, there is now a similar crate at silvanshade/async-codec-lite.
ah sorry, moved it here: https://github.com/YZITE/futures/tree/main/crates/codec