-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the Bytes crate #184
Comments
Can you say more about what kinds of changes you are proposing? API signatures would be helpful. |
It doesn't have to be complete. |
And please also show the alternative. What does code look like if support isn't added to this crate? And why was existing support okay for In general, you are proposing a major feature addition to this library. I need to see it spelled out more. |
I probably misspoke. A common way to deal with large buffers is to do something like An example of what it would look like: pub trait ByteBytes {
#[inline]
fn split_once_str<B: ?Sized + AsRef<[u8]>>(
&self,
splitter: &B,
) -> Option<(Bytes, Bytes)>;
} The idea is you can return new |
I'm familiar with the It seems like you would run into the same problem with |
Not really, lets take a common example: I need to split the body of an HTTP request. With |
Hi!
Just an idea, I am starting to move code from using
Arc<Vec<u8>>
to using theBytes
crate (https://github.com/tokio-rs/bytes). This means losing a lot of the capabilities provided bybstr
since the traits likeByteSlice
always return&[u8]
but they could just as easily returnBytes
objects.Let me know what you think, happy to pinch in for the implementation. It should be fairly similar to
ByteSlice
just without the references.Thanks
The text was updated successfully, but these errors were encountered: