bytes
bytes copied to clipboard
Utilities for working with bytes
Add support for fallible allocation by adding `BytesMut::try_reserve()`. This does change the MSRV to 1.57, so I don't know how we should handle it. Adding it under a feature flag,...
Hi, I need a reverse bytes, which is back off not advance. What should I do? Implement a new struct with three required methods and those functions and Vtables again?...
As per discussion in #518.
I'm using bytes 1.0.1. It seems the `Take::chunks_vectored` method doesn't follow the contract from the trait about providing all the chunks that can fit. From [documentation](https://docs.rs/bytes/1.0.1/bytes/trait.Buf.html#method.chunks_vectored). > If chunk_vectored does...
The `BytesMut::unsplit` method can be expensive if the two ranges aren't contiguous and if it requires a memory allocation for a new buffer. This PR makes the existing `BytesMut::try_unsplit` public...
Is there any chance of making `Bytes` support fallible allocations? e.g. `try_reserve()`? This [can be done on stable](https://docs.rs/fallible_collections/0.4.0/src/fallible_collections/vec.rs.html#439) using allocator APIs. Contrary to a popular belief, Rust can run out...
I needed an easier way to handle reading and writing architecture specific sizes so I have implemented the additional functions. I couldn't think of good architecture specific examples unless the...
I was looking for a way to join two contiguous Bytes into one, but there isn't such a thing. It's common in parsing code to read multiple logical messages into...
There is some discussion of this in #425. This implements Write for BytesMut exactly as is done for Vec here: https://doc.rust-lang.org/src/std/io/impls.rs.html#370-402