bytes
bytes copied to clipboard
Utilities for working with bytes
If you run the following code in miri: bytes::Bytes::from_static(b"abc").slice_from(1) you get the error: > error[E0080]: Miri evaluation error: trying to reborrow for Unique, but parent tag does not have an...
I see APIs have been proposed like this before but all I want is a method to _try_ to unsplit a `Bytes` as I think that should be possible in...
At some point in the future, we will want to expose the vtable backing `Bytes`. This issue tracks relevant discussion as well as API issues that relate to the vtable....
This means that in particular you can't use `StreamExt::concat` on a stream of `Bytes`. Is that change intentional or something that got lost in the rewrites?
```rust let mut bytes = BytesMut::with_capacity(32); unsafe { bytes.set_len(16); } let mut rest = bytes.split_off(16); // unsafe { // rest.set_len(8); // } println!("{}", rest.capacity()); // 16 bytes.unsplit(rest); println!("{}", bytes.capacity()); //...
I've developed [a library](https://github.com/aticu/pre) for my bachelor's thesis to make working with unsafe code a little bit safer. It works by annotating unsafe functions with the preconditions that need to...
I have been looking for a zero-copy way of sharing mmap content via `Bytes`. I noticed the vtable feature added by #294 and didn't find follow-ups. I wonder if `bytes`...
Some applications may want the capacity of `BytesMut` to be reported exactly as previously requested (unless more is already reserved). `BytesMut::reserve` allows for allocation excess and over-reserving in expectation for...
I was trying to replace `&'a [u8]` with `&'a mut dyn Buf` but I fail with lifetime problem ```rust use bytes; // 0.5.4 use bytes::*; #[derive(Debug)] struct Frame { fn...
`BufQueue` is a `VecDeque` which implements `Buf` and caches the remaining size. This utility can be used to implement outgoing network buffer. Imagine this use case: ``` type Header =...