Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Can't `Vec<u8>` serve the same purpose?


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: