tokio-rs/bytes ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Rust library for working with raw bytes, with a clean API for handling shared byte buffers and mutable byte buffers.

I want the library to expose types like Bytes and BytesMut, plus helper traits for reading and writing data from buffers in a simple way. It should work well for networking style code, where copying data as little as possible matters. Please make it support normal Rust with std by default, but also let me turn std off for no_std use. Add optional serde support too, and keep that disabled unless I ask for it.

Please make it feel like a real reusable crate, with good tests, examples, and documentation comments so it is easy to understand how to use. If you need to check the current recommended Rust patterns or docs for anything, look them up online.