3 ms·
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 er
by tatterdemalion 9y ago
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.
- valarauca1 9y agoCan't `Vec<u8>` serve the same purpose?
- tatterdemalion 9y agoThen 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.