Re:Rust: Not So Great For Codec Implementing
by tatterdemalion on Tuesday August 01, 2017 @01:25PM
(#14903117)
Bytes is intended for use with the tokio ecoystem where you cna't use references often because borrowing across a yield point in a future would be a lifetime error.
[ Parent
| on HN ]
Re:Rust: Not So Great For Codec Implementing
by valarauca1 on Tuesday August 01, 2017 @02:09PM
(#14903592)
Can't `Vec<u8>` serve the same purpose?
Re:Rust: Not So Great For Codec Implementing
by tatterdemalion on Tuesday August 01, 2017 @03:58PM
(#14904714)
Then you have to do a deep clone every time. Arc<Vec<u8>> is also not sufficient, because Bytes lets you share a reference count among slices to different offset into the buffer.