Closed
Description
Copied from tokio-rs/tokio-io#28
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 as parameter to serialize the message into. Vec 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 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