This repository was archived by the owner on May 6, 2018. It is now read-only.
This repository was archived by the owner on May 6, 2018. It is now read-only.
BytesMut lacks a direct implementation of std::io::Write #28
Closed
Description
I'm currently using the codec
module to implement a framed tansport.
Before the refactoring, the encode
-method of the old Codec
trait received a Vec<u8>
as parameter to serialize the message into. Vec<u8>
directly implements std::io::Write
which makes it very easy to put any kind of data into it, since most implementations have some way of writing into an instance of Write
.
Now the Vec<u8>
has been replaced by BytesMut
, which lacks a direct implementation of that trait. Write
-compatibility is only archievable through into_writer
, which consumes the BytesMut
. Consuming is not possible, though, because the method only receives the BytesMut
by &mut
.
Is this desired behavior?
Metadata
Metadata
Assignees
Labels
No labels